-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: CacheSynchronization.afterCompletion does not call flush
PostPosted: Thu Sep 23, 2004 11:10 am 
Newbie

Joined: Tue Sep 21, 2004 5:00 am
Posts: 4
Location: Munich
I am looking at trying to integrate transactions from a third-party framework with hibernate. Assume that the Framework uses JTA (it doesn't, but I can probably implement some basic JTA or JTA-like transaction manager).

In particular, I would like it if a commit from within the framework flushed and committed the hibernate session.

I noticed that Session.connect() and JTATransaction.begin() both register JTA synchronisation callbacks as follows:

Code:
   tx.registerSynchronization( new CacheSynchronization(this) )

where tx is an externally obtained javax.transaction.Transaction.

The CacheSynchronization class calls Session.afterTransactionCompletion(). This does a lot of stuff, but appears not to do a flush.

However, if I commit from Hibernate explicitly, it does flush().

So, I am wondering:

1. Why this is (that the synchronisation does not call flush) and if there are any problems with registering a Synchronizer that did flush, and if not, how to do it?
2. On rollback, would I need to call an 'unFlush' method, or would afterTransactionCompletion() clear out the pending requests.
3. If anyone knows of any tutorials on implementing JTA classes for a simple framework. In particular, collaborations between classes.

thanks

_________________
Richard


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 23, 2004 11:18 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
I implemented this in Hibernate3 CVS, actually. It is controlled by a property setting.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.