|
From: Colin S. <col...@ex...> - 2004-09-24 17:00:09
|
Juergen, I was poking around in the HibernateInterceptor and HibernateTemplate code following a forum post, and unless I'm missing something, HibernateInterceptor (correctly) binds the new Session that is created to the current thread even if there is no transaction already existing to synchronize to, but on the other hand, on the execute() call HibernateTemplate will only bind the Session to the thread if transaction synchronization is active. Am I missing something? If this is correct, this does not seem appropriate to me, as HibernateTemplate should be (and is listed in the JavaDocs) as the programattic equivalent of HibernateInterceptor, and nested HibernateTemplate calls should utilize a thread-bound session put there by the outermost one, regardless of transaction settings, not create a new Session. Am I missing something? Colin |