Subject A fix for JDBC-362
Author
From what I understand the bheaviour of the jaybird prior 2.2.0 was incorrect when it is used in distributed environment. setAutoCommit(true) does not fail in jaybird 2.1.x and it replaces current transaction coordinator with autocommit version.

I made this patch for 2.2.5 where I test additionally before calling setAutoCommit9true) and do not call it when in distributed environment. Transaction coordinator is already set to managed versions in setManaged so nothing else should happen here.
   
This changed worked in my test case but I'm not sure it is 100% correct so please let me know if there is more to be considered here for this problem.

Index: AbstractConnection.java
===================================================================
--- AbstractConnection.java    (revision 60051)
+++ AbstractConnection.java    (working copy)
@@ -563,7 +563,9 @@
                         try {
                             txCoordinator.rollback();
                         } finally {
-                            setAutoCommit(true);
+                            if (!mc.inDistributedTransaction()) {
+                                setAutoCommit(true);
+                            }
                         }
                     }