-->
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: Interceptor.postFlush and rollback
PostPosted: Thu Jan 20, 2005 6:01 am 
Expert
Expert

Joined: Tue Oct 05, 2004 9:45 am
Posts: 263
Hibernate version: 2.1.7
hi there,

i've got a for me strange behaviour and i just want to ask, if i'm thinking wrong ...

i need to write HistoryLogs to my db, so i use a Interceptor. In the postFlush-method all HistoryLogs are persisted ...
To write the insert-statements, i'm using the connection of the current session (for using the same transaction). The sql for the insert-Statement is generated from 'net.sf.hibernate.sql.Insert'.

My problem is now, that i'm getting an error and the insert fails ... well .. that's my fault ... the bigger problem is, that the resulting rollback doesn't work ...
That means:

a) an object X is deleted in DB
b) commit the changes
b2) writing the history-log-entry (which fails)
b3) perform rollback (the logs show me that it happens)

c) -> object X is not rolledback ?! It's deleted in db.

And yes .. the logs show me, that autocommit is false ;)

So my question is ... is the postFlush-method to late to do a complete rollback?

I mean i shouldn't get an error there, and i will fix that ... my question is just to be sure, what i can do ...

thanx!
curio

P.S.: Sorry for not showing an example ... if it's required, i will create a small one ...


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.