void closeImpl() throws SQLException { jdbcLogger.logger.trace("Connection closeImpl: " + this); boolean release = false; boolean remove = false; synchronized (this) { if (useCount.decrementAndGet() == 0) { if (_poolingEnabled) { if (_transactionalDriverXAConnectionConnection != null) { _transactionalDriverXAConnectionConnection.setTransaction(null); } release = true; } else if (_transactionalDriverXAConnectionConnection != null) { if (_theConnection != null && !_theConnection.isClosed()) { _theConnection.close(); } _transactionalDriverXAConnectionConnection.closeCloseCurrentConnection(); remove = true; } } } if (remove) { ConnectionManager.remove(this); } else if (release) { ConnectionManager.release(this); } }
/** * @return the XAResource associated with the current XAConnection. */ protected final XAResource getXAResource() { try { return _transactionalDriverXAConnectionConnection.getResource(); } catch (Exception e) { return null; } }
/** * Can only set readonly before we use the connection in a given * transaction! */ public void setReadOnly(boolean ro) throws SQLException { if (!_transactionalDriverXAConnectionConnection.inuse()) { getConnection().setReadOnly(ro); } else throw new SQLException(jdbcLogger.i18NLogger.get_setreadonly()); }
if (_transactionalDriverXAConnectionConnection.validTransaction(tx)) if ((tx.getStatus() == Status.STATUS_ACTIVE && !tx.delistResource(_transactionalDriverXAConnectionConnection.getResource(), XAResource.TMSUCCESS)) || (tx.getStatus() == Status.STATUS_MARKED_ROLLBACK && !tx.delistResource(_transactionalDriverXAConnectionConnection.getResource(), XAResource.TMFAIL))) throw new SQLException( jdbcLogger.i18NLogger.get_delisterror());
if (!_transactionalDriverXAConnectionConnection.setTransaction(tx)) throw new SQLException( jdbcLogger.i18NLogger.get_alreadyassociated() ); xares = _transactionalDriverXAConnectionConnection.getResource();
if (!_transactionalDriverXAConnectionConnection.validTransaction(tx)) throw new SQLException( jdbcLogger.i18NLogger.get_alreadyassociatedcheck());
return _theConnection; XAConnection xaConn = _transactionalDriverXAConnectionConnection.getConnection();
if (_transactionalDriverXAConnectionConnection.validTransaction(tx)) if ((tx.getStatus() == Status.STATUS_ACTIVE && !tx.delistResource(_transactionalDriverXAConnectionConnection.getResource(), XAResource.TMSUCCESS)) || (tx.getStatus() == Status.STATUS_MARKED_ROLLBACK && !tx.delistResource(_transactionalDriverXAConnectionConnection.getResource(), XAResource.TMFAIL))) throw new SQLException( jdbcLogger.i18NLogger.get_delisterror());
if (!_transactionalDriverXAConnectionConnection.setTransaction(tx)) throw new SQLException( jdbcLogger.i18NLogger.get_alreadyassociated() ); xares = _transactionalDriverXAConnectionConnection.getResource();
if (!_transactionalDriverXAConnectionConnection.validTransaction(tx)) throw new SQLException( jdbcLogger.i18NLogger.get_alreadyassociatedcheck());
return _theConnection; XAConnection xaConn = _transactionalDriverXAConnectionConnection.getConnection();
void closeImpl() throws SQLException { jdbcLogger.logger.trace("Connection closeImpl: " + this); boolean release = false; boolean remove = false; synchronized (this) { if (useCount.decrementAndGet() == 0) { if (_poolingEnabled) { if (_transactionalDriverXAConnectionConnection != null) { _transactionalDriverXAConnectionConnection.setTransaction(null); } release = true; } else if (_transactionalDriverXAConnectionConnection != null) { if (_theConnection != null && !_theConnection.isClosed()) { _theConnection.close(); } _transactionalDriverXAConnectionConnection.closeCloseCurrentConnection(); remove = true; } } } if (remove) { ConnectionManager.remove(this); } else if (release) { ConnectionManager.release(this); } }
if (_transactionalDriverXAConnectionConnection.validTransaction(tx)) if ((tx.getStatus() == Status.STATUS_ACTIVE && !tx.delistResource(_transactionalDriverXAConnectionConnection.getResource(), XAResource.TMSUCCESS)) || (tx.getStatus() == Status.STATUS_MARKED_ROLLBACK && !tx.delistResource(_transactionalDriverXAConnectionConnection.getResource(), XAResource.TMFAIL))) throw new SQLException( jdbcLogger.i18NLogger.get_delisterror());
if (!_transactionalDriverXAConnectionConnection.setTransaction(tx)) throw new SQLException( jdbcLogger.i18NLogger.get_alreadyassociated() ); xares = _transactionalDriverXAConnectionConnection.getResource();
/** * Can only set readonly before we use the connection in a given * transaction! */ public void setReadOnly(boolean ro) throws SQLException { if (!_transactionalDriverXAConnectionConnection.inuse()) { getConnection().setReadOnly(ro); } else throw new SQLException(jdbcLogger.i18NLogger.get_setreadonly()); }
/** * @return the XAResource associated with the current XAConnection. */ protected final XAResource getXAResource() { try { return _transactionalDriverXAConnectionConnection.getResource(); } catch (Exception e) { return null; } }
if (!_transactionalDriverXAConnectionConnection.validTransaction(tx)) throw new SQLException( jdbcLogger.i18NLogger.get_alreadyassociatedcheck());
return _theConnection; XAConnection xaConn = _transactionalDriverXAConnectionConnection.getConnection();
void closeImpl() throws SQLException { jdbcLogger.logger.trace("Connection closeImpl: " + this); boolean release = false; boolean remove = false; synchronized (this) { if (useCount.decrementAndGet() == 0) { if (_poolingEnabled) { if (_transactionalDriverXAConnectionConnection != null) { _transactionalDriverXAConnectionConnection.setTransaction(null); } release = true; } else if (_transactionalDriverXAConnectionConnection != null) { if (_theConnection != null && !_theConnection.isClosed()) { _theConnection.close(); } _transactionalDriverXAConnectionConnection.closeCloseCurrentConnection(); remove = true; } } } if (remove) { ConnectionManager.remove(this); } else if (release) { ConnectionManager.release(this); } }
if (_transactionalDriverXAConnectionConnection.validTransaction(tx)) if ((tx.getStatus() == Status.STATUS_ACTIVE && !tx.delistResource(_transactionalDriverXAConnectionConnection.getResource(), XAResource.TMSUCCESS)) || (tx.getStatus() == Status.STATUS_MARKED_ROLLBACK && !tx.delistResource(_transactionalDriverXAConnectionConnection.getResource(), XAResource.TMFAIL))) throw new SQLException( jdbcLogger.i18NLogger.get_delisterror());