-->
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.  [ 3 posts ] 
Author Message
 Post subject: multiple open sessions with in a single transaction
PostPosted: Tue Nov 15, 2005 5:23 pm 
Beginner
Beginner

Joined: Mon Feb 23, 2004 5:11 pm
Posts: 39
I am using H3 and have some basic questions (or ideas) regarding multiple open sessions with in a single transction. Any body know of any links/articles that deal with this topic?

Specifically,

If and when whould the updates made to an object in one session (and flushed) be visible in a new session in the same transaction? (first session is still open when the new session in created and the object is loaded). (dirty read between the sessions???)

Also, what ever the behavior is, would it be any different between standard property updates and collection updates (add/remove to collection)?

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 16, 2005 4:04 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Are you talking about distributed transactions ?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 16, 2005 4:04 am 
Expert
Expert

Joined: Thu Jan 29, 2004 2:31 am
Posts: 362
Location: Switzerland, Bern
Quote:
If and when whould the updates made to an object in one session (and flushed) be visible in a new session in the same transaction? (first session is still open when the new session in created and the object is loaded).


The two sessions do not know each other and there will be no synchronization. A session just reads what is in the DB or takes the entities out of its cach.

This means if you read something with the second session it
  1. reads it from the DB if it's not in the session cache. The updated data is read.
  2. takes it from the cache if it finds it there. This means that your session might contain stale data.


HTH
Ernst


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.