[hibernate-dev] remove ID on failed flush
emmanuel at hibernate.org
Fri Oct 14 12:35:31 EDT 2011
Check out hibernate.use_identifier_rollback in the doc.
Also please use the user forum for such questions. This is the hibernate development mailing list.
On 14 oct. 2011, at 18:10, Marcel Hörr wrote:
> 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:
> or the conversations in this thread (and the conversations linked in that thread):
> 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
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
More information about the hibernate-dev