public Connection createConnection() throws SQLException { // create a new connection Connection connection = connectionFactory.createConnection(); // create a XAResource to manage the connection during XA transactions XAResource xaResource = new LocalXAResource(connection); // register the xa resource for the connection transactionRegistry.registerConnection(connection, xaResource); return connection; }
public Connection createConnection() throws SQLException { // create a new connection Connection connection = connectionFactory.createConnection(); // create a XAResource to manage the connection during XA transactions XAResource xaResource = new LocalXAResource(connection); // register the xa resource for the connection transactionRegistry.registerConnection(connection, xaResource); return connection; }
@Override public Connection createConnection() throws SQLException { final long start = System.nanoTime(); final DatabasePoolCreateEvent event = new DatabasePoolCreateEvent(getDatabaseInfo(name)); try { return MonitoredConnection.monitor(name, "dbcp", connectionFactory.createConnection()); } finally { event.setElapsedTimeNano(System.nanoTime() - start); SystemInstance.get().fireEvent(event); } } };
@Override public Connection createConnection() throws SQLException { final long start = System.nanoTime(); final DatabasePoolCreateEvent event = new DatabasePoolCreateEvent(getDatabaseInfo(name)); try { return MonitoredConnection.monitor(name, "dbcp", connectionFactory.createConnection()); } finally { event.setElapsedTimeNano(System.nanoTime() - start); SystemInstance.get().fireEvent(event); } } };
synchronized public Object makeObject() throws Exception { Connection conn = _connFactory.createConnection(); if(null != _stmtPoolFactory) { KeyedObjectPool stmtpool = _stmtPoolFactory.createPool(); conn = new PoolingConnection(conn,stmtpool); stmtpool.setFactory((PoolingConnection)conn); } return new PoolableConnection(conn,_pool,_config); }
public Object makeObject() throws Exception { Connection conn = _connFactory.createConnection(); if (conn == null) { throw new IllegalStateException("Connection factory returned null from createConnection"); } initializeConnection(conn); if(null != _stmtPoolFactory) { KeyedObjectPool stmtpool = _stmtPoolFactory.createPool(); conn = new PoolingConnection(conn,stmtpool); stmtpool.setFactory((PoolingConnection)conn); } return new PoolableConnection(conn,_pool,_config); }
public Object makeObject() throws Exception { Connection conn = _connFactory.createConnection(); if (conn == null) { throw new IllegalStateException("Connection factory returned null from createConnection"); } initializeConnection(conn); if(null != _stmtPoolFactory) { KeyedObjectPool stmtpool = _stmtPoolFactory.createPool(); conn = new PoolingConnection(conn,stmtpool); stmtpool.setFactory((PoolingConnection)conn); } return new PoolableConnection(conn,_pool,_config); }
/** * Uses the configured XAConnectionFactory to create a {@link PoolableManagedConnection}. * Throws <code>IllegalStateException</code> if the connection factory returns null. * Also initializes the connection using configured initialization sql (if provided) * and sets up a prepared statement pool associated with the PoolableManagedConnection * if statement pooling is enabled. */ synchronized public Object makeObject() throws Exception { Connection conn = _connFactory.createConnection(); if (conn == null) { throw new IllegalStateException("Connection factory returned null from createConnection"); } initializeConnection(conn); if(null != _stmtPoolFactory) { KeyedObjectPool stmtpool = _stmtPoolFactory.createPool(); conn = new PoolingConnection(conn,stmtpool); stmtpool.setFactory((PoolingConnection)conn); } return new PoolableManagedConnection(transactionRegistry,conn,_pool,_config); }
/** * Uses the configured XAConnectionFactory to create a {@link PoolableManagedConnection}. * Throws <code>IllegalStateException</code> if the connection factory returns null. * Also initializes the connection using configured initialization sql (if provided) * and sets up a prepared statement pool associated with the PoolableManagedConnection * if statement pooling is enabled. */ synchronized public Object makeObject() throws Exception { Connection conn = _connFactory.createConnection(); if (conn == null) { throw new IllegalStateException("Connection factory returned null from createConnection"); } initializeConnection(conn); if(null != _stmtPoolFactory) { KeyedObjectPool stmtpool = _stmtPoolFactory.createPool(); conn = new PoolingConnection(conn,stmtpool); stmtpool.setFactory((PoolingConnection)conn); } return new PoolableManagedConnection(transactionRegistry,conn,_pool,_config); }
try { con = connectionFactory.createConnection(); connect = true; } catch (Exception e) {
try { con = connectionFactory.createConnection(); connect = true; } catch (Exception e) {