By design, DetachedCriteria are intended to be serializable and this is something we have been leveraging in our result paging system for years. We are now hitting an issue when adding subqueries to the detached criteria where our session replication breaks on the serialization attempt.
In contrast to the rest of the DetachedCriteria object graph, the following classes are not serializable:
Instances of these can be present inside of any SubqueryExpression instance, which is connected to a DetachedCriteria as follows:
An example criteria that ends up with a PropertySubqueryExpression in that List:
Hibernate 4.3.4, MySQL 5.5