Package com.atomikos.datasource.pool

Examples of com.atomikos.datasource.pool.CreateConnectionException


    currentProxy = AtomikosJmsConnectionProxy.newInstance ( xaConnection , jmsTransactionalResource , this , props );
    return currentProxy;
  }

  protected void testUnderlyingConnection() throws CreateConnectionException {
    if ( isErroneous() ) throw new CreateConnectionException ( this + ": connection is erroneous" );
  }
View Full Code Here


    XAConnection xac;
    try {
      xac = xaConnectionFactory.createXAConnection();
      return new AtomikosPooledJmsConnection(xac, jmsTransactionalResource, atomikosConnectionFactory);
    } catch (JMSException ex) {
      throw new CreateConnectionException("error creating JMS connection", ex);
    }
  }
View Full Code Here

    Connection c;
    try {
      c = getConnection();
    } catch (SQLException e) {
      Configuration.logWarning ( "NonXAConnectionFactory: failed to create connection: " , e );
      throw new CreateConnectionException ( "Could not create JDBC connection" , e );
    }
    return new AtomikosNonXAPooledConnection ( c , props , readOnly );
  }
View Full Code Here

      if ( Configuration.isInfoLoggingEnabled() ) Configuration.logInfo ( "setting isolation level to " + defaultIsolationLevel);
      connection.setTransactionIsolation ( defaultIsolationLevel );
    }
    catch (SQLException ex) {
      Configuration.logWarning ( "cannot set isolation level to " + defaultIsolationLevel, ex);
      throw new CreateConnectionException ( "The configured default isolation level " + defaultIsolationLevel +
          " seems unsupported by the driver - please check your JDBC driver documentation?" , ex );
    }
  }
View Full Code Here

    return connection;
  }

  protected void testUnderlyingConnection() throws CreateConnectionException {
    String testQuery = getTestQuery();
    if ( isErroneous() ) throw new CreateConnectionException ( this + ": connection is erroneous" );
    if (testQuery != null) {
      if ( Configuration.isDebugLoggingEnabled() ) Configuration.logDebug ( this + ": testing connection with query [" + testQuery + "]" );
      Statement stmt = null;
      try {
        stmt = connection.createStatement();
        //use execute instead of executeQuery - cf case 58830
        stmt.execute(testQuery);
        stmt.close();
      } catch ( Exception e) {
        //catch any Exception - cf case 22198
        throw new CreateConnectionException ( "Error executing testQuery" ,  e );
      }
      if ( Configuration.isDebugLoggingEnabled() ) Configuration.logDebug ( this + ": connection tested OK" );
    }
    else {
      if ( Configuration.isDebugLoggingEnabled() ) Configuration.logDebug ( this + ": no test query, skipping test" );
View Full Code Here

    JdbcConnectionProxyHelper.setIsolationLevel ( connection , getDefaultIsolationLevel() );
    return AtomikosConnectionProxy.newInstance ( connection , sessionHandleState , hmsg );
  }

  protected void testUnderlyingConnection() throws CreateConnectionException {
    if ( isErroneous() ) throw new CreateConnectionException ( this + ": connection is erroneous" );
    String testQuery = getTestQuery();
    if (testQuery != null) {
      if ( Configuration.isDebugLoggingEnabled() ) Configuration.logDebug ( this + ": testing connection with query [" + testQuery + "]" );
      Statement stmt = null;
      try {
        stmt = connection.createStatement();
        //use execute instead of executeQuery - cf case 58830
        stmt.execute(testQuery);
        stmt.close();
      } catch ( Exception e) {
        //catch any Exception - cf case 22198
        throw new CreateConnectionException ( "Error executing testQuery" ,  e );
      }
      if ( Configuration.isDebugLoggingEnabled() ) Configuration.logDebug ( this + ": connection tested OK" );
    }
    else {
      if ( Configuration.isDebugLoggingEnabled() ) Configuration.logDebug ( this + ": no test query, skipping test" );
View Full Code Here

      XAConnection xaConnection = xaDataSource.getXAConnection();
      return new AtomikosXAPooledConnection ( xaConnection, jdbcTransactionalResource, props );
    } catch ( SQLException e ) {
      String msg = "XAConnectionFactory: failed to create pooled connection - DBMS down or unreachable?";
      Configuration.logWarning ( msg , e );
      throw new CreateConnectionException ( msg , e );
    }
  }
View Full Code Here

    return connection;
  }

  protected void testUnderlyingConnection() throws CreateConnectionException {
    String testQuery = getTestQuery();
    if ( isErroneous() ) throw new CreateConnectionException ( this + ": connection is erroneous" );
    if (testQuery != null) {
      if ( LOGGER.isDebugEnabled() ) LOGGER.logDebug ( this + ": testing connection with query [" + testQuery + "]" );
      Statement stmt = null;
      try {
        stmt = connection.createStatement();
        //use execute instead of executeQuery - cf case 58830
        stmt.execute(testQuery);
        stmt.close();
      } catch ( Exception e) {
        //catch any Exception - cf case 22198
        throw new CreateConnectionException ( "Error executing testQuery" ,  e );
      }
      if ( LOGGER.isDebugEnabled() ) LOGGER.logDebug ( this + ": connection tested OK" );
    }
    else {
      if ( LOGGER.isDebugEnabled() ) LOGGER.logDebug ( this + ": no test query, skipping test" );
View Full Code Here

    JdbcConnectionProxyHelper.setIsolationLevel ( connection , getDefaultIsolationLevel() );
    return AtomikosConnectionProxy.newInstance ( connection , sessionHandleState , hmsg );
  }

  protected void testUnderlyingConnection() throws CreateConnectionException {
    if ( isErroneous() ) throw new CreateConnectionException ( this + ": connection is erroneous" );
    String testQuery = getTestQuery();
    if (testQuery != null) {
      if ( LOGGER.isDebugEnabled() ) LOGGER.logDebug ( this + ": testing connection with query [" + testQuery + "]" );
      Statement stmt = null;
      try {
        stmt = connection.createStatement();
        //use execute instead of executeQuery - cf case 58830
        stmt.execute(testQuery);
        stmt.close();
      } catch ( Exception e) {
        //catch any Exception - cf case 22198
        throw new CreateConnectionException ( "Error executing testQuery" ,  e );
      }
      if ( LOGGER.isDebugEnabled() ) LOGGER.logDebug ( this + ": connection tested OK" );
    }
    else {
      if ( LOGGER.isDebugEnabled() ) LOGGER.logDebug ( this + ": no test query, skipping test" );
View Full Code Here

      if ( LOGGER.isInfoEnabled() ) LOGGER.logInfo ( "setting isolation level to " + defaultIsolationLevel);
      connection.setTransactionIsolation ( defaultIsolationLevel );
    }
    catch (SQLException ex) {
      LOGGER.logWarning ( "cannot set isolation level to " + defaultIsolationLevel, ex);
      throw new CreateConnectionException ( "The configured default isolation level " + defaultIsolationLevel +
          " seems unsupported by the driver - please check your JDBC driver documentation?" , ex );
    }
  }
View Full Code Here

TOP

Related Classes of com.atomikos.datasource.pool.CreateConnectionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.