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.  [ 3 posts ] 
Author Message
 Post subject: remove ID on failed flush
PostPosted: Fri Oct 14, 2011 12:47 pm 
Newbie

Joined: Fri Oct 14, 2011 12:46 pm
Posts: 3
hey guys,

i'm currently facing the following situation:

we're using the current stable version of hibernate (3.6.7) as a jpa-vendor with an oracle database. the ids of our entities are generated by a sequence, which works fine. but in the case of a failure during the save action, our entities get an id although they have not been saved to the database. in case of a sequence generated id this is quite bad, because we can not use this id again. the id should be set to null.

of course i have read the comments in this ticket:
https://hibernate.onjira.com/browse/HB-1014

or the conversations in this thread (and the conversations linked in that thread):
viewtopic.php?f=1&t=942461

but reading the above articles wasn't quite helpful, because no solution or hint in the right direction was suggested. a few people stated, that this behavior was fixed in hibernate 3, but that seems not be the case.

do you guys have any suggestions how to handle this problem? or is this something application code has to deal with in your opinion (i hope not ;-))?

any help appreciated.

- marcel


Top
 Profile  
 
 Post subject: Re: remove ID on failed flush
PostPosted: Fri Oct 14, 2011 12:51 pm 
Newbie

Joined: Fri Oct 14, 2011 12:46 pm
Posts: 3
on the mailing list the usage of "hibernate.use_identifier_rollback" was suggested. however, a few people reported(in the mentioned articles above) that the usage does not solve the problem. also the documentation is not very detailed about this property.
is it a system property? how to use it in a spring-jpa environment?


Top
 Profile  
 
 Post subject: Re: remove ID on failed flush
PostPosted: Mon Oct 17, 2011 7:40 am 
Newbie

Joined: Fri Oct 14, 2011 12:46 pm
Posts: 3
Marcel H. wrote:
on the mailing list the usage of "hibernate.use_identifier_rollback" was suggested. however, a few people reported(in the mentioned articles above) that the usage does not solve the problem. also the documentation is not very detailed about this property.
is it a system property? how to use it in a spring-jpa environment?

the suggestion on the mailing list was not correct, as christian pointed out here:
viewtopic.php?f=9&t=970213&start=15#wrapheader

using "hibernate.use_identifier_rollback" ist not an option.


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