-->
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: How to know when an entity is made dirty
PostPosted: Mon Apr 23, 2007 11:58 am 
Newbie

Joined: Tue Apr 05, 2005 3:51 am
Posts: 7
Location: Switzerland
This is probably an easy question for anybody having more experience than me, but I'm quite stuck on it.

I have some code that should only do reads to my Hibernate POJO. Still Hibernate issues UPDATE statements. So I guess I have some error in my code and it changes the POJO at some point.

Is there an easy way to see when the "write" occurs ? Something quick and dirty, like setting a breakpoint in some hibernate class ...

Thanks for your help !

Hibernate version:
3.1.3

Name and version of the database you are using:
Oracle 10g


Top
 Profile  
 
 Post subject: Re: How to know when an entity is made dirty
PostPosted: Mon Apr 23, 2007 5:22 pm 
Newbie

Joined: Fri Nov 10, 2006 7:26 pm
Posts: 11
gehel wrote:
Is there an easy way to see when the "write" occurs ? Something quick and dirty, like setting a breakpoint in some hibernate class ...

First, set <property name="show_sql">true</property> in your hibernate.cfg.xml file.

But as far as determining in your code where that happens, you could write an Interceptor and then dump the stack..... But I have no experience with Interceptors.....


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 24, 2007 2:20 am 
Newbie

Joined: Tue Apr 05, 2005 3:51 am
Posts: 7
Location: Switzerland
Thank you for your answer !

I already have show_sql=true. That's how I realized that Hibernate issues more UPDATE statement than what I was expecting.

I'll try to go for the interceptors ... but I'm not entirely convinced yet ... Isnt there an easy way out ?


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.