-->
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: problem lock
PostPosted: Fri Oct 04, 2013 5:15 am 
Newbie

Joined: Fri Oct 04, 2013 5:02 am
Posts: 1
hi!
i try to lock an entire table with hibernate.
I would obtain a max value from an attribute of a table, and so use this incremented value of one unit to insert a new row in this table. So the mistake is that i don't obtain the lock of the table and so if i launch two processes that execute this operation in the same time, the last process throws an exception because of the duplication of the primary key.
The most important thing is that i can't set the primary key as an autoincrement key.

Thanks for all answers.


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.