-->
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.  [ 4 posts ] 
Author Message
 Post subject: Hibernate can remember the deleted record id
PostPosted: Tue Sep 06, 2005 8:27 pm 
Beginner
Beginner

Joined: Thu Jun 30, 2005 4:14 pm
Posts: 25
Hi folks,

currenly I am using Hibernare 3 and Jboss4.0.2.

In my application, I want to save the student objects.

the mapping file is like this

<class name="Student" table="tblStudent" lazy="true">
<id name="id" column="ClientOutputID" type="int" unsaved-value="null" >
<generator class="increment"/>
</id>


After I saved 3 student instance, their id are 1,2,3.
then I deleted id 3.

But then I saved a new instance, the id is 4, not 3.

What is wrong? I supoosed the id shoud be 3, based on increment from 2.

Please help!

Thank you very much!

Chwang


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 07, 2005 2:18 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
This is the expected behavior. The next one will be 5.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 07, 2005 11:53 am 
Beginner
Beginner

Joined: Thu Jun 30, 2005 4:14 pm
Posts: 25
DennisByrne,

But I tested it witiout Jboss enviroment.

which means in local mode.
I deleted id 3 then save, next id is 3.

The reson is Jboos setup?

Thank you!

Chwang


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 07, 2005 12:24 pm 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
Can you define "Jboss enviroment"? I'm observing the first set of behavior you describe in several standalone Tomcat apps. May I ask why this is important?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.