-->
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: Intermittent auto-flush problem with bogus updates
PostPosted: Tue May 04, 2004 1:20 pm 
Newbie

Joined: Mon Oct 06, 2003 12:02 pm
Posts: 17
Hello,

I'm using Hibernate 2.1 with MSSQL 2K. Periodically (and of course unrecreatably) I am seeing some odd behavior that I can only attibute to auto-flush. I am loading an object with a set of calls to session.find().

Using the MSSQL profiler, I can watch the SQL executed against the database. Normally, I see all SELECTs as expected. Occasionally, on our production system, I will encounter a situation where the session seems to be flushed during each find(). So I see SELECT, SELECT, SELECT, then a pattern of a set of UPDATES, SELECT, a set of UPDATES, SELECT, and so on.

I'm guessing that this has to do with the session auto-flushing, but I'm a little confused as to why the session gets into this situation. Since I can't recreate this behavior in development, it makes it a bit tough as well.

It appears as if the session is flagging as 'dirty' the objects just loaded in the session via find. Any ideas if this could be so?

I have changed the flush mode of the session from AUTO to COMMIT and will see if that has an effect. However, this is just a guess.

Regards,
Dave


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 05, 2004 7:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Something is wrong with the class that is being updated. Broken get/set pair or something.

Use the Hibernate log to determine which particular property is broken (grep "is dirty").


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 05, 2004 7:47 am 
Senior
Senior

Joined: Sun Jan 04, 2004 2:46 pm
Posts: 147
I had this problem where I was returning null for the value of a nested collection in the POJO which causes hibernate to think any objects of that type are dirty when it does a session flush because it compares null to it's internal ( lazy ) collection implementation. See if the production system does this for one or just a few particular objects/classes to narrow it down.

Cheers.

Myk.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 05, 2004 9:04 am 
Newbie

Joined: Mon Oct 06, 2003 12:02 pm
Posts: 17
Gavin and Myk,

Thanks for the tips. I will post what I find.

Dave


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.