-->
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: IncrementGenerator misuse?
PostPosted: Sat Jun 14, 2014 6:39 am 
Newbie

Joined: Sat Jun 14, 2014 6:27 am
Posts: 1
Hello,

I have a bug in my application and I don't know if it a bug from hibernate or more a misused from me or my conf.
Here are the step to reproduce:
-I launch my application
-I create a Person Object and close my hibernate session
-I create another one from another jvm
-I create a third one from my application
Then it crashes my app telling me that the id is already used in db.

I use org.hibernate:hibernate:3.2.6-ga artifact
Person is configured with the IncrementGenerator class. When I look into it, I see, it get max id for the person class only the first time (org.hibernate.id.IncrementGenerator, line 43 and 94) and not not each time a new hibernate session is opened.

Do you know a way to configured Person or my app a way that each application can be aware of the next id to use to generate a new Person?

Thank you in advance for your help!
Fanch


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.