Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3
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: Mysql V5
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
I have implemented a
org.hibernate.event.PostInsertEventListener and wired it up to the SessionFactory (via Spring).
The listener executes a task in a new thread.
The task queries via Hibernate, but the results do not contain the newly inserted data.
If I pause the task (Thread.sleep(...)) before the query then the newly inserted data is contained in the returned list.
I assume that this happens because the transaction has not yet completed and been committed, although i would expect the data to be committed before any Post Insert events are fired.....
Is there any way to configure the events to fire after the transaction has totally completed?
Any advice would be appreciated...
Grant