On 19-03-2021 21:36,
radek...@centrum.cz wrote:
> Thank you for quick reaction.
>
>> You changed two things together, so it is a bit hard to attribute the
>> problem to either Jaybird or Firebird. What happens if you use Jaybird
>> 2.2 with Firebird 3 or Jaybird 3 with Firebird 2?
>
> I tried the Jaybird 3 with Firebird 2 too. I got the same result:
> Database Product: Firebird 2.5 (LI-V2.5.9.27139)
> JDBC Driver: Jaybird JCA/JDBC driver (3.0)/JDBC Driver: Jaybird JCA/JDBC driver (4.0.2)
>
> Database Product: Firebird 3.0 (LI-V3.0.5.33220)
> JDBC Driver: Jaybird JCA/JDBC driver (3.0)/Jaybird JCA/JDBC driver (4.0.2)
According to this you're using Jaybird 3 and Jaybird 4.
> Only when I use older version of FB2, I got following "exception" from dropTable(con2) method (instead of stuck):
> Resource Exception. unsuccessful metadata update; object TABLE "TEST" is in use [SQLState:42000, ISC error code:335544351]
> Database Product: Firebird 2.1 (LI-V2.1.7.18553)
> JDBC Driver: Jaybird JCA/JDBC driver (3.0)/Jaybird JCA/JDBC driver (4.0.2)
Ok, as Arioch The asked, are you using Firebird 2.1 Classic or
SuperClassic and are now using Firebird 3 SuperServer? That could
explain the difference between waiting on a lock and the in use error
message.
However, the big difference between Jaybird 2.2 and Jaybird 3 is that
the wire protocol was reimplemented and enhanced with newer features.
The problem you're describing seems to be
http://tracker.firebirdsql.org/browse/JDBC-638, or at least it goes away
when using your reproduction test with a Jaybird 4.0.3 snapshot.
When implementing these changes, I followed the implementation of the
native client, which includes a number of optimizations like not
immediately sending certain messages from client to server, but instead
waiting for other activity before sending them. And that not immediately
sending is what causes the problem.
The auto-commit occurs on statement completion (when you finish reading
the result set or close the result set, whichever comes first), followed
by the close of the statement. This close is not flushed as there is no
other activity on the connection, so serverside the statement is still
prepared holding locks on metadata objects.
When you use explicit commit, you commit after closing the statement, so
the close of the statement is flushed to the server, and the locks on
metadata objects are released.
>> However, it would be helpful to have full reproduction program and not
>> just an outline. Could you create one and send it to the list, or create
>> a ticket in the tracker and upload it there?
>
> I have already attached simple tests in my first message (DDLAutommit.java), sorry for typo ;)
> Java class contains 2 test methods, which can be used for reproduction (I hope it is enough, or?):
> - testDDLAutoCommit()
> - testDDLManualCommit()
> I didn't want to create issue in tracker directly without discussion here, but yes I can create a ticket of course, when attached test is enough.
Sorry, I had entirely missed the attachment. I can confirm it reproduces
the problem, and also that it goes away after testing with a 4.0.3
snapshot version and 3.0.11 snapshot version that includes the fix for
JDBC-638.
If you want, I can provide you with a snapshot of those versions. The
only change compared to 3.0.10 / 4.0.2 is this fix.
Mark
--
Mark Rotteveel