I responded to this on the railo google groups but thought I'd revie this thread over here:
Here's a quick summary of the issue:
"I'm experiencing a locking issue under load with query of queries that I'm hoping someone may have some insight on. I am able to reproduce the lock on queries that contain a group by or a count clause (there may be other scenarios, but these I can reliably reproduce). Below are two thread dump excerpts, the first from the thread doing the locking, and the second from the locked thread. I'm running 3.3.4.003 final. I'm not quite sure where to go from here. This is hard to reproduce but while under production load. Thank you for your help!"
We're seeing the same problem. When observing the railo server using Fusion Reactor, on occasion we see one request blocking a number of other requests. When looking at each request's stack trace, all open requests are blocking on executeQoQ. Each request thread appears to be attempting to access a lock that is still being held by the first request thread. In our case, the first offending request is running a large QoQ that takes a significant amount of time to complete and therefore creates a backup in any further request threads that attempt to perform a QoQ.
I believe Rory is right that the issue stems from the synchronization lock call on line 324 of HSQLDBHandler.java. Would the code function properly without this lock? What shared resource is being acquired here that requires the lock? Would it be possible to implement this function in a non-blocking way?
Thank you so much for your time!