-->
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: Auto FlushMode in concurrent sessions on the same entity
PostPosted: Wed Dec 03, 2003 3:46 pm 
Beginner
Beginner

Joined: Tue Nov 18, 2003 12:34 am
Posts: 39
Location: Dallas, Texas, US
Hello,
From the docs, I understand that the Auto FlushMode of a Session does a flush (sometimes) before the next query execution. So, my question is what happens when a query in a different session (at the same time) is executed on the same entity. Does flush automatically happen before the query even if the query is in a different concurrent session?
Thanks,
Madhan.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 03, 2003 4:18 pm 
Expert
Expert

Joined: Tue Sep 16, 2003 4:06 pm
Posts: 318
Location: St. Petersburg, Russia
I suppose two different sessions live completely independed from each other. Query in one session may cause flush() only in the same session.

Moreover (if you worry about visibility of the data inserted in one session to another session): flush does not involve transaction commit and since different sessions live in different transactions, another session will not see inserted data even after explicit flush()


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 03, 2003 8:47 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Quote:
since different sessions live in different transactions, another session will not see inserted data even after explicit flush()


Well, it depends upon the db isolation level...


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.