-->
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: Consecutive JTA transactions
PostPosted: Fri Oct 03, 2003 9:31 pm 
Beginner
Beginner

Joined: Wed Aug 27, 2003 4:17 pm
Posts: 27
Location: California, USA
What's the best way to use Hibernate with a thread that commits a JTA transaction and immediately begins another? The best way I've found is to call (in pseudocode):
Code:
hibernate.Session.disconnect();
UserTransaction.commit();
hibernate.Session.reconnect();

... which works. But it seems wasteful to release the JDBC connection and then immediately allocate another one. Is there a more efficient way?

Just to add difficulty, I need to use global (JCS) caching; which means I can't pass a JDBC connection to hibernate.SessionFactory.openSession. (Or so I understand from http://forum.hibernate.org/old//893667.html.)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 03, 2003 9:34 pm 
Beginner
Beginner

Joined: Wed Aug 27, 2003 4:17 pm
Posts: 27
Location: California, USA
Oops; I meant to say:
Code:
hibernate.Session.disconnect();
UserTransaction.commit();
UserTransaction.begin();
hibernate.Session.reconnect();

(But you knew that.)


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.