Subject Re: [Firebird-Java] DataExpress problem JayBird 3 Beta
Author Mark Rotteveel
On 23-12-2016 09:38, hugo.larson@... [Firebird-Java] wrote:
> You are absolutely right that the connection object cannot be removed.
> What I do is to replace it with a dummy Database object.
> I managed to hastily make a Eclipse project the provokes the exception.
> Will mail it to you soon.

With the code you sent, and inspection of the Jaybird code, I detected
an incomplete synchronization during the creation/prepare of a prepared

Adding this synchronization made the exceptions go away. This seems to
indicate either parallel usage, or an unsynchronized read which shows a
stale value of the transaction. However on several runs of your test
application, it now shows an exhaustion of the connection pool instead
(some runs complete, some don't).

This seems to be caused by the fact that your code gets a connection
from the pool twice (maybe more?) for a single thread as myRefresh
(indirectly) calls itself (see stacktrace below). This also causes
dummyDb to be overwritten with an actual connection (which may or may
not be involved in the original problem).

"Thread-4" prio=6 tid=0x000000000ed24800 nid=0x11b0 waiting on condition
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000780f185e0> (a
at java.util.concurrent.locks.LockSupport.park(
at dx.DbPool.getConn(
at dx.MyQueryDataSet.setPoolconn(
at dx.MyQueryDataSet.execType(
at dx.MyQueryDataSet.myRefresh(
at com.borland.dx.dataset.StorageDataSet.refresh(Unknown Source)
at com.borland.dx.sql.dataset.QueryDataSet.refresh(Unknown Source)
at dx.MyQueryDataSet.execType(
at dx.MyQueryDataSet.myRefresh(
at dx.MyQueryDataSet.refresh(
at dx.MainDbTest.execQds2(
at dx.MainDbTest.access$200(
at dx.MainDbTest$

Mark Rotteveel