-->
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: INSERT statements and flush() behavior
PostPosted: Sun Mar 07, 2010 9:00 pm 
Newbie

Joined: Thu Sep 10, 2009 3:03 pm
Posts: 5
I have the following two parallel transactions
TX1:
begin TX1
insert(person(unique_id=1))
flush
commit TX1

TX2:
begin TX2
insert(person(unique_id=1))
flush
commit TX2

I know that only one commit statement will succeed due to the unique constraint. My question is, is there any possibility that the flush() call will succeed and the commit() fails due to a constraint violation exception.

I'm in read committed isolation level using Oracle db.


Top
 Profile  
 
 Post subject: Re: INSERT statements and flush() behavior
PostPosted: Mon Mar 08, 2010 3:41 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Quote:
is there any possibility that the flush() call will succeed and the commit() fails due to a constraint violation exception.

Not at Hiberante level.
But I know there are some databases which let choose the user if indexes should be validated immediately or at commit-time.
I don't know if Oracle has this feature. (Maybe its better to ask in a Oracle-user-forum)


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.