@Override public void invalidate( Connection conn ) { try { pool.invalidate( (DelegatingConnection) conn ); } catch ( Exception e ) { throw new RuntimeException( e ); } }
@Override public void destroy() { try { pool.destroy(); } catch ( Exception e ) { throw new ResourceException( e.getLocalizedMessage(), e ); } }
public LegacyConnectionProvider( String url, String user, String password, boolean readOnly, LegacyConnectionProviderMetadata metadata ) { this.metadata = metadata; // hardcoded as until 3.2 int poolMinSize = 5; int poolMaxSize = 25; if ( metadata != null ) { pool = new ConnectionPool( metadata.getIdentifier().getId(), url, user, password, readOnly, poolMinSize, poolMaxSize ); } else { pool = new ConnectionPool( "<unspecified>", url, user, password, readOnly, poolMinSize, poolMaxSize ); } }
@Override public Connection getConnection() { try { return pool.getConnection(); } catch ( SQLException e ) { throw new ResourceException( e.getLocalizedMessage(), e ); } }