I had the same issue as you mentioned.
I solved it by setting flush mode to MANUAL and resetting it back to the original at the end while executing a call to the stored procedure.
Here is code :
Code:
public class MyEventListener implements PreUpdateEventListener, PostUpdateEventListener,
PreInsertEventListener, PostInsertEventListener
{
......
public boolean onPreUpdate(final PreUpdateEvent event) {
....
final FlushMode flushMode = session.getFlushMode();
// disable flush mode
session.setFlushMode(FlushMode.MANUAL);
session.executeNativeUpdate(
new NativeSQLQuerySpecification("call MY_STORE_PROC( ? )", new NativeSQLQueryReturn[] {}, null),
new QueryParameters(Hibernate.LONG, myid));
// restore flush mode
session.setFlushMode(flushMode);
}
}
regards.