We're stress-testing JBoss 3.0.6 connecting to an Oracle 188.8.131.52 database server.
Even under medium loads, we're seeing a lot of exceptions thrown by Oracle, either "Fetch out of sequence" or "Not in a transaction".
We suspect that due to a race condition, the connection pool isn't being careful enough about not handing out a given connection more than once at a time.
As a stop-gap, we tried synchronizing our code that requests a connection from the pool. We synchronized on the monitor of the instance's class object. The exceptions disappeared, but we suffered a measurable loss in performance -- presumably because of the gross granularity of the critical section in question.
I am curious to know if others have seen this same problem.