Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
hibernate 3.0.5
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
oracle 9.2.0.1
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Hi, i have a 'strange' situation here in my code. I'm using managed versioning for all of my tables.
Here's the sequence of my code does :
1. I update a persistent model (now it's dirty)
2. I execute a HQL query (the session flushed, the version of the persistent model get increased by 1)
3. I update the persistent model again (it gets dirty again)
4. The transaction ends, the session gets flushed and the version increases again.
Based on what i read on Hibernate in action, the session sometimes gets flushed (and got dirty models increase their version) before an execution of a query. If the result of the query could be affected by the modified persistent models, the session will flush first, and then the query gets executed.
The problem here is that, here in my case, i make a query to a table which doesnt have any relation at all to the modified persistent model, no relation at all in each hbm.xml. So it means that the result of the query wont be affected by the modification of the persistent model.
I wonder why the session flushes. The version gets increased twice. My preference is just to have the version increased only once (>.<)
Please help :)
Best regards,
Albert Kam