|
From: Juergen H. <ju...@in...> - 2005-01-11 16:19:38
|
Everybody, I've implemented a change that I've had in mind for a while: HibernateTemplate exposes a proxied Hibernate Session to HibernateCallbacks, suppressing close calls and automatically applying query cache settings and transaction timeouts to created Query and Criteria objects. This is the default now; it can be turned off via HibernateTemplate's "exposeNativeSession" property. Consequently, HibernateTemplate's "createQuery", "getNamedQuery" and "createCriteria" methods are deprecated now. They caused quite a bit of confusion, as they were not intended to be called directly like the "find" convenience methods (for example) but rather just within HibernateCallbacks. This is not necessary anymore now; the exposed Session proxy automatically cares for this. Analogously, JdoTemplate can expose a proxied JDO PersistenceManager to JdoCallbacks, suppressing close calls and applying transaction timeouts to created Query objects (provided that a JdoDialect is specified). This is not the default, though, as it's still common practice to cast to a vendor-specific PersistenceManager class in current JDO DAOs. It can be activated through turning JdoTemplate's "exposeNativePersistenceManager" property to "false". Juergen |