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
|