public void close () throws SQLException { //see case 21666: don't call setup //checkSetup (); if ( ds_ != null ) ds_.close (); }
/** * @see Referenceable */ public Reference getReference () throws NamingException { return createReference ( resource_.getName () ); }
/** * @see javax.sql.DataSource */ public Connection getConnection () throws SQLException { HeuristicMessage msg = null; return getConnection ( msg ); }
ds_ = JtaDataSourceImp.getInstance ( getUniqueResourceName () ); "", "", xads_, xidFactory ); factory.setExclusive ( exclusive_ ); ds_ = new JtaDataSourceImp ( factory, poolSize_, connectionTimeout_, validation, !validation, validatingQuery_ , testOnBorrow_ );
public PrintWriter getLogWriter () throws SQLException { checkSetup (); return ds_.getLogWriter (); }
/** * @see com.atomikos.jdbc.HeuristicDataSource */ public int getLoginTimeout () throws SQLException { checkSetup (); return ds_.getLoginTimeout (); }
public TransactionalResource getTransactionalResource () { try { checkSetup (); } catch ( SQLException err ) { err.printStackTrace (); throw new RuntimeException ( err.getMessage () ); } return ds_.getTransactionalResource (); }
/** * @see javax.naming.spi.ObjectFactory */ public Object getObjectInstance ( Object obj , Name name , Context nameCtx , Hashtable environment ) throws Exception { if ( !(obj instanceof Reference) ) return null; Reference ref = (Reference) obj; if ( !ref.getClassName () .equals ( "com.atomikos.jdbc.JtaDataSourceImp" ) ) return null; // as required by JNDI String url = (String) ref.get ( "ResourceName" ).getContent (); return JtaDataSourceImp.getInstance ( url ); }
/** * Cleans up the instance, and closes the pool. */ public void close () { pool_.cleanup (); removeFromMap ( resource_.getName () ); if ( autoRegister_ ) Configuration.removeResource ( resource_.getName () ); }
autoRegister_ = registerWithTM; if ( !allowDuplicateNames ) addToMap ( resource_.getName (), this ); if ( registerWithTM ) { Configuration.addResource ( resource_ );
ds_ = JtaDataSourceImp.getInstance ( getUniqueResourceName () ); factory.setExclusive ( exclusive_ ); ds_ = new JtaDataSourceImp ( factory, poolSize_, connectionTimeout_, validation, !validation, validatingQuery_ , testOnBorrow_ );
/** * @see com.atomikos.jdbc.HeuristicDataSource */ public PrintWriter getLogWriter () throws SQLException { checkSetup (); return ds_.getLogWriter (); }
public int getLoginTimeout () throws SQLException { checkSetup (); return ds_.getLoginTimeout (); }
/** * Get the transactional resource. * * @return TransactionalResource The resource as it is used by the * transaction service during recovery. */ protected TransactionalResource getTransactionalResource () { try { checkSetup (); } catch ( SQLException err ) { err.printStackTrace (); throw new RuntimeException ( err.getMessage () ); } return ds_.getTransactionalResource (); }
public Connection getConnection () throws SQLException { checkSetup (); return ds_.getConnection (); }
public void run () { // called at shutdown time ds_.close (); } }
public Reference getReference () throws NamingException { return JtaDataSourceImp.createReference ( getUniqueResourceName () ); }
public Connection getConnection ( String user , String pw , HeuristicMessage msg ) throws SQLException { checkSetup (); return ds_.getConnection ( user, pw, msg ); }
/** * @see com.atomikos.jdbc.HeuristicDataSource */ public void close () throws SQLException { //DON'T setup: see issue 10098 //checkSetup (); if ( ds_ != null ) { //issue 10098: don't call setup -> added null check ds_.close (); } }
/** * @see com.atomikos.jdbc.HeuristicDataSource#getConnection(java.lang.String, * java.lang.String, java.lang.String) */ public Connection getConnection ( String user , String passwd , String msg ) throws SQLException { HeuristicMessage hm = new StringHeuristicMessage ( msg ); return getConnection ( user, passwd, hm ); }