-->
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.  [ 4 posts ] 
Author Message
 Post subject: retrieving hibernate transaction id
PostPosted: Tue Jan 03, 2012 6:07 pm 
Newbie

Joined: Sat May 06, 2006 9:08 am
Posts: 8
I would like to be able to track all the database changes that are committed in a particular transaction. Is there a way to identify the transaction in which a database change was committed?

If not, would it be possible associate an identifier with a transaction and retrieve that id in the Synchronization.beforeCompletion() invocation for each entity committed in the transaction?


Top
 Profile  
 
 Post subject: Re: retrieving hibernate transaction id
PostPosted: Tue Jan 03, 2012 6:47 pm 
Beginner
Beginner

Joined: Wed Nov 21, 2007 10:24 am
Posts: 25
Are you wanting to do anything particular with the data? You could try envers if you want a copy of the data that was committed together.


Top
 Profile  
 
 Post subject: Re: retrieving hibernate transaction id
PostPosted: Tue Jan 03, 2012 8:35 pm 
Newbie

Joined: Sat May 06, 2006 9:08 am
Posts: 8
Thanks, but Envers isn't an option. We are publishing Change Data Capture events via Hibernate Event listeners. It would be useful downstream to include transaction information in the events.


Top
 Profile  
 
 Post subject: Re: retrieving hibernate transaction id
PostPosted: Wed Jan 04, 2012 5:43 am 
Senior
Senior

Joined: Tue Oct 28, 2008 10:39 am
Posts: 196
We are using

Code:
session.getTransaction().hashCode();


inside JBoss to trace certain actions, it's not persisted somewhere. For us it's okay to know which calls inside our server belong to that transaction (combined with the timestamps inside the entities).


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