Expert |
|
Joined: Sat Jan 17, 2004 2:57 pm Posts: 329 Location: In the basement in my underwear
|
If it's the same type of issue we ran into it's not a Hibernate problem but a problem with C3P0 and it's implementation of statement caching with the global setting.
The problem happens when you have closed statements available for cleanup that are associated with connection that is active in the pool.
Connection 1 opens and closes a number of prepared statements so that they become available for reaping and starts a long running query (someone runs a massive report). In executing the query Oracle obtains a lock on the session until the query completes. Connections 2+ try to obtain a statement but the pool is full so the cache tries to cull the oldest statements which happen to be from connection 1. Each statement will only be processed once but it will try to obtain a lock on the connection in order to close the statement. However, the lock is still in place from the running query and will only be released once the query completes.
If you are still fighting with it I recommend looking at using a per connection cache instead. In our case we completely killed statement caching for the short term while we evaluate other pooling options. We'll take a hit in performance vs hard blocks.
_________________ Some people are like Slinkies - not really good for anything, but you still can't help but smile when you see one tumble down the stairs.
|
|