Steve Ebersole wrote:
In XA I can have many physical DB connections all running in the same tx context.As long as both of the sessions are on the same underlying Connection this should be achievable. Otherwise you'd run into txn isolation issues.
Using the current HibernateContext code as an example, we could implement something like "flush on retrieval". HibernateContext does something very similar in its txn Synchronization; on txn completion, it checks to see if the session is dirty and if so flushes it. So in the HibernateContext class, it be as simple as modifying the getSession() method to flush the session prior to returning it if it was pre-existing and it is dirty.
But I tend to think it is better to let application code handle these explicit intermediate flushes. Obviously it makes sense at txn completion time.
Well, this approach has rather nasty complications. Say you are writing an EJB application, have the session propagated as thread local and automatically flush the session at very end of the transaction. You developed/debugged using single VM configuration and now deploy the same app into a cluster. Guess what, the same transaction can now spread over multiple VMs and your EJBs are not sharing the same session anymore.
Anyways, all I am saying is that it would be nice to have automatic intermediate flushes. Unfortunately I do not see any reasonably simple solution.
------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel