/** * @see com.atomikos.jdbc.HeuristicDataSource#getConnection(com.atomikos.icatch.HeuristicMessage) */ public Connection getConnection ( HeuristicMessage msg ) throws SQLException { DTPPooledConnection ret = (DTPPooledConnection) pool_ .getPooledConnection (); ret.addConnectionEventListener ( this ); return ret.getConnection ( msg ); }
/** * @see javax.sql.ConnectionEventListener#connectionErrorOccurred(javax.sql.ConnectionEvent) */ public void connectionErrorOccurred ( ConnectionEvent arg ) { DTPPooledConnection pc = (DTPPooledConnection) arg.getSource (); pc.removeConnectionEventListener ( this ); pc.setInvalidated (); }
ct = ctm.getCompositeTransaction (); inTx = pc_.isInResourceTransaction (); if ( ct != null && ct.getProperty ( TransactionManagerImp.JTA_PROPERTY_NAME ) != null && !pc_.isDiscarded () ) { pc_.setResourceTransaction ( restx ); restx.resume (); LOGGER pc_.setInvalidated (); pc_.close (); if ( LOGGER.isDebugEnabled() ) LOGGER.logDebug ( "Exception in pooled connection - closing it", i ); String msg = "Exception in pooled connection: unexpected error - closing it"; LOGGER.logWarning ( msg, e ); pc_.setInvalidated (); pc_.close (); AtomikosSQLException.throwAtomikosSQLException ( e.getMessage() , e );
/** * @see javax.sql.ConnectionEventListener#connectionClosed(javax.sql.ConnectionEvent) */ public void connectionClosed ( ConnectionEvent arg ) { DTPPooledConnection pc = (DTPPooledConnection) arg.getSource (); if ( pc.isDiscarded () ) { pc.removeConnectionEventListener ( this ); pool_.putBack ( pc ); } }