-->
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.  [ 2 posts ] 
Author Message
 Post subject: Gather sql statements for transaction
PostPosted: Sat May 16, 2015 3:47 am 
Newbie

Joined: Mon Jun 21, 2010 9:03 am
Posts: 7
Dear members,

we want to setup a replication database asynchronously, based on the executed sql statements during a sucessful commit.

First we tried to setup the logging of the sql statements with p6spy. This works fine, but we do not have a relation to the transaction and so all statements are logged.

Is there a possibility in hibernate where we can provide a "listener" where the sql statements (not hql) can be gathered.

Best regards,
Gerold


Top
 Profile  
 
 Post subject: Re: Gather sql statements for transaction
PostPosted: Mon May 18, 2015 5:54 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Hi,
I don't if it would work but maybe you can create an interceptor and check the value passed thorough
Code:
Inteceptor#onPrepareStatement

You can find more information on how to create an interceptor or how to process events in the documentation:
http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch14.html

Hope this help,
Davide


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