in src/main/java/org/apache/openejb/cts/DriverManagerXADataSource.java [200:223]
public synchronized void commit(final Xid xid, final boolean flag) throws XAException {
if (xid == null) throw new NullPointerException("xid is null");
if (!this.xid.equals(xid)) throw new XAException("Invalid Xid: expected " + this.xid + ", but was " + xid);
try {
// make sure the connection isn't already closed
if (connection.isClosed()) {
throw new XAException("Conection is closed");
}
// A read only connection should not be committed
if (!connection.isReadOnly()) {
connection.commit();
}
} catch (final SQLException e) {
throw (XAException) new XAException().initCause(e);
} finally {
try {
connection.setAutoCommit(originalAutoCommit);
} catch (final SQLException e) {
}
this.xid = null;
}
}