initialize XA resource
@@ -380,10 +380,9 @@ public final class SQLServerXAResource implements javax.transaction.xa.XAResourc
SQLServerCallableStatement cs = null;
try {
synchronized (this) {
- if (controlConnection == null) {
+ if (!xaInitDone) {
try {
synchronized (xaInitLock) {
- if (!xaInitDone) {
SQLServerCallableStatement initCS = null;
initCS = (SQLServerCallableStatement) controlConnection.prepareCall("{call master..xp_sqljdbc_xa_init_ex(?, ?,?)}");
@@ -428,9 +427,6 @@ public final class SQLServerXAResource implements javax.transaction.xa.XAResourc
xaLogger.finer(toString() + " exception:" + xex);
throw xex;
}
-
- xaInitDone = true;
- }
}
}
catch (SQLServerException e1) {
@@ -440,6 +436,7 @@ public final class SQLServerXAResource implements javax.transaction.xa.XAResourc
xaLogger.finer(toString() + " exception:" + form.format(msgArgs));
SQLServerException.makeFromDriverError(null, null, form.format(msgArgs), null, true);
}
+ xaInitDone = true;
}
}
