-->
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.  [ 1 post ] 
Author Message
 Post subject: Threadsafe issue on Extended session (long transactions)
PostPosted: Fri Dec 30, 2005 7:57 am 
Newbie

Joined: Fri Jan 28, 2005 12:13 pm
Posts: 2
Hibernate 3.
Transactions managed by JBoss.

One approch to support long transactions in Hibernate 3 is the Extended session. A single Session instance are used for the whole conversation. The Session is disconnected from any underlying JDBC connection when waiting for user interaction. Beginning a new database transaction on an old session obtains a new connection and resumes the session.

Usually the relationship between Session and Transaction is one-to-one because Session is not threadsafe.

My question is:
If two different clients requests a EJB SessionBean on JBoss server to update an object previous loaded in same Session, two different transaction will start and both will try to update the object on same session. This scenario could happen, right?
So how can I ensure that have to no thread safe problems when use the Extend session approach?

Thanks,

Pedro Cardoso


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

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.