-->
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: ISession.Delete method don't reset object identifier?
PostPosted: Wed Sep 21, 2005 7:30 am 
Hi all, Im new using nhibernate and I dont understand when an object pass from persistence to transient.

When I delete a persistence object with ISession.Delete method nHibernate dont reset de idenfier value to unsaved-value indicated in my mappings files in order to make de object transient.

I have a test that create a new Object, save it, and then delete it. In that moment de object is transient, but it has de id value of the row that just had been delete from database.
If try to save de object again with saveupdate method, hibernate try to do and Update because de object not have de unsaved-value as identifier and exception is thrown because de row was deleted.

My set method for de id is private and I dont want to set de id to unsaved value myself.

Actually the test expected de exception and works well, but i wonder is ther any way of avoid the exception.

Thanks


Top
  
 
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.