-->
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: Possible to reset identifier in domain object at rollback?
PostPosted: Fri Sep 02, 2005 9:08 am 
Newbie

Joined: Tue Jun 28, 2005 9:21 am
Posts: 2
We have a Stateless Session bean (using CMT) that first saves (saveOrUpdate) an object graph with Hibernate and then calls an external system in the same transaction. If the external system throws an exception, the db insertion is rolled back, but the new domain objects in the object graph has gotten their identifier fields updated by Hibernate.

Are there any ways of resetting these identifier fields, that is, can I hook into Hibernate's transaction handling so I can do something like (pseudo code):

Code:
for(domainObject : newDomainObjects)
{
    getPersister(domainObject).resetIdentifier(...)
}


when the transaction rolls back?


Regards,
Stig Kleppe-Jørgensen


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.