-->
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: nonExists (SessionImpl) vs. isolation level "read commi
PostPosted: Wed May 18, 2005 12:10 pm 
Newbie

Joined: Wed May 18, 2005 10:27 am
Posts: 4
Location: Germany
Hibernate version: 2.1.8
Name and version of the database you are using: Oracle 9.2

All,

just stumbled over a truly strange problem:

Isolation mode "read committed" (which is the default for most databases, e.g. Oracle) means that new rows which have been inserted by other - previously concurrently running, but now committed - DB sessions may get visible during my own current DB session's lifetime.

So it has to be possible by definition of the isolation level "read committed" that an attempt to load an object with a given key which has failed when trying it for the first time in a current Hibernate Session can succeed when trying the same for a second time from the same Session, supposed that the object with the respective key has been inserted and committed in the meantime by a different session.

The problem here seems to be that the Hibernate SessionImpl manages a nonExists HashSet where it stores keys for which it "knows" that the respective objects have not been existing when this was tried for the last time (a somewhat strange idea anyway!?).

In our scenario, hitting the database directly using plain SQL from within the same DB connection/DB session will find and return the newly inserted row during the second try, while the Hibernate Session still fails to return it on get() or load(), because it will use the cached information from the first try and not be able detect that the newly inserted row - due to the "read committed" isolation mode - now has become visible.

Is there any known solution to/workaround for this? Should I proceed and file an issue?

Many thanks in advance,

Andreas


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.