/** * Return a connection from the connection pool which already has the auto-commit disabled. * * @return a fresh JDBC connection from the connection pool * @throws SQLException in case a new connection could not be established */ public KiWiConnection getConnection() throws SQLException { if (!initialized) { throw new SQLException("persistence backend not initialized; call initialise before acquiring a connection"); } if (connectionPool == null) { throw new SQLException("connection pool is closed, database connections not available"); } KiWiConnection con = new KiWiConnection(this,configuration.getDialect(),cacheManager); if(getDialect().isBatchSupported()) { con.setBatchCommit(configuration.isTripleBatchCommit()); con.setBatchSize(configuration.getTripleBatchSize()); } return con; }
/** * Return a connection from the connection pool which already has the auto-commit disabled. * * @return a fresh JDBC connection from the connection pool * @throws SQLException in case a new connection could not be established */ public KiWiConnection getConnection() throws SQLException { if (!initialized) { throw new SQLException("persistence backend not initialized; call initialise before acquiring a connection"); } if (connectionPool == null) { throw new SQLException("connection pool is closed, database connections not available"); } KiWiConnection con = new KiWiConnection(this,configuration.getDialect(),cacheManager); if(getDialect().isBatchSupported()) { con.setBatchCommit(configuration.isTripleBatchCommit()); con.setBatchSize(configuration.getTripleBatchSize()); } return con; }