I am running into a shared lock with sqlserver after a merge operation. It seems merge uses two different connections. One of them inserts an object into a table and the other one selects from it. This causes a lock since the insert doesnot close the session, and the later on select blocks on it because of the newly inserted row. The lock happens after the merge when transaction is committed. This object is a child object of the main merged object.
I am not too familiar with hibernate. First why would it use multiple connections on a single thread of execution ? Second is there any way to force these sql statements into the same connection. Third, Is there a good way to track hibernate to see which sql statement ties to which jdbc pool type of thing ?
I am using glassfish 2.1 with jndi data source. The hibernate version is 3.2.6 ga and sql server is 2008.
Thx for your help in advance.
|