The problem reported in thread Jaybird 5. Rollback not completed, state was ROLLING_BACK suggests that Jaybird 5 has a thread safety issue that especially surfaces during finalization (as multiple threads might be finalizing objects in an indeterminate order).
For this issue, the following needs to be done:
-
Review locking and volatile use, especially surrounding checks of connection/attachment validity
-
See about removing some finalizers.
For example, finalization of transactions is pretty much pointless, because they only - in normal logic - become eligible for GC when the connection becomes eligible for GC, and closing the connection will roll back active transactions server-side anyway.
Unfortunately, given the socket itself might be finalized while another finalizer is doing it's work, it's entirely possible we cannot fully prevent this issue.
Jaybird 6 and Jaybird 7 (master) probably have the same thread safety issue, but due to removal of finalization and (limited) replacement with Cleaner, this is less likely to surface like it does in Jaybird 5. Changes to thread safety for this issue will need to be frontported to Jaybird 6 and 7 (master)
The problem reported in thread Jaybird 5. Rollback not completed, state was ROLLING_BACK suggests that Jaybird 5 has a thread safety issue that especially surfaces during finalization (as multiple threads might be finalizing objects in an indeterminate order).
For this issue, the following needs to be done:
Review locking and volatile use, especially surrounding checks of connection/attachment validity
See about removing some finalizers.
For example, finalization of transactions is pretty much pointless, because they only - in normal logic - become eligible for GC when the connection becomes eligible for GC, and closing the connection will roll back active transactions server-side anyway.
Unfortunately, given the socket itself might be finalized while another finalizer is doing it's work, it's entirely possible we cannot fully prevent this issue.
Jaybird 6 and Jaybird 7 (master) probably have the same thread safety issue, but due to removal of finalization and (limited) replacement with Cleaner, this is less likely to surface like it does in Jaybird 5. Changes to thread safety for this issue will need to be frontported to Jaybird 6 and 7 (master)