public void setAutoCommit(boolean auto) throws SQLException { if (_isolation != TRANSACTION_NONE) { super.setAutoCommit(auto); _curAutoCommit = auto; } }
public void setAutoCommit(boolean auto) throws SQLException { if (_isolation != TRANSACTION_NONE) { super.setAutoCommit(auto); _curAutoCommit = auto; } }
public void setAutoCommit(boolean auto) throws SQLException { if (_isolation != TRANSACTION_NONE) { super.setAutoCommit(auto); _curAutoCommit = auto; } }
public void setAutoCommit(boolean auto) throws SQLException { if (_isolation != TRANSACTION_NONE) { super.setAutoCommit(auto); _curAutoCommit = auto; } }
public void setAutoCommit(boolean autocommit) throws SQLException { // the sybase jdbc driver demands that the Connection always // be rolled back before autocommit status changes. Failure to // do so will yield "SET CHAINED command not allowed within // multi-statement transaction." exceptions try { super.setAutoCommit(autocommit); } catch (SQLException e) { // failed for some reason: try rolling back and then // setting autocommit again. if (autocommit) super.commit(); else super.rollback(); super.setAutoCommit(autocommit); } } }
public void setAutoCommit(boolean autocommit) throws SQLException { // the sybase jdbc driver demands that the Connection always // be rolled back before autocommit status changes. Failure to // do so will yield "SET CHAINED command not allowed within // multi-statement transaction." exceptions try { super.setAutoCommit(autocommit); } catch (SQLException e) { // failed for some reason: try rolling back and then // setting autocommit again. if (autocommit) super.commit(); else super.rollback(); super.setAutoCommit(autocommit); } } }
public void setAutoCommit(boolean autocommit) throws SQLException { // the sybase jdbc driver demands that the Connection always // be rolled back before autocommit status changes. Failure to // do so will yield "SET CHAINED command not allowed within // multi-statement transaction." exceptions try { super.setAutoCommit(autocommit); } catch (SQLException e) { // failed for some reason: try rolling back and then // setting autocommit again. if (autocommit) super.commit(); else super.rollback(); super.setAutoCommit(autocommit); } } }
public void setAutoCommit(boolean autocommit) throws SQLException { // the sybase jdbc driver demands that the Connection always // be rolled back before autocommit status changes. Failure to // do so will yield "SET CHAINED command not allowed within // multi-statement transaction." exceptions try { super.setAutoCommit(autocommit); } catch (SQLException e) { // failed for some reason: try rolling back and then // setting autocommit again. if (autocommit) super.commit(); else super.rollback(); super.setAutoCommit(autocommit); } } }
public void setAutoCommit(boolean autocommit) throws SQLException { // the sybase jdbc driver demands that the Connection always // be rolled back before autocommit status changes. Failure to // do so will yield "SET CHAINED command not allowed within // multi-statement transaction." exceptions try { super.setAutoCommit(autocommit); } catch (SQLException e) { // failed for some reason: try rolling back and then // setting autocommit again. if (autocommit) super.commit(); else super.rollback(); super.setAutoCommit(autocommit); } } }
public InputStream getLOBStream(JDBCStore store, ResultSet rs, int column) throws SQLException { DelegatingConnection conn = (DelegatingConnection)store .getConnection(); conn.setAutoCommit(false); LargeObjectManager lom = getLargeObjectManager(conn); if (rs.getInt(column) != -1) { LargeObject lo = lom.open(rs.getInt(column)); return lo.getInputStream(); } else { return null; } }
public InputStream getLOBStream(JDBCStore store, ResultSet rs, int column) throws SQLException { DelegatingConnection conn = (DelegatingConnection)store .getConnection(); conn.setAutoCommit(false); LargeObjectManager lom = getLargeObjectManager(conn); if (rs.getInt(column) != -1) { LargeObject lo = lom.open(rs.getInt(column)); return lo.getInputStream(); } else { return null; } }
public InputStream getLOBStream(JDBCStore store, ResultSet rs, int column) throws SQLException { DelegatingConnection conn = (DelegatingConnection)store .getConnection(); conn.setAutoCommit(false); LargeObjectManager lom = getLargeObjectManager(conn); if (rs.getInt(column) != -1) { LargeObject lo = lom.open(rs.getInt(column)); return lo.getInputStream(); } else { return null; } }
public InputStream getLOBStream(JDBCStore store, ResultSet rs, int column) throws SQLException { DelegatingConnection conn = (DelegatingConnection)store .getConnection(); conn.setAutoCommit(false); LargeObjectManager lom = getLargeObjectManager(conn); if (rs.getInt(column) != -1) { LargeObject lo = lom.open(rs.getInt(column)); return lo.getInputStream(); } else { return null; } }
public InputStream getLOBStream(JDBCStore store, ResultSet rs, int column) throws SQLException { DelegatingConnection conn = (DelegatingConnection)store .getConnection(); conn.setAutoCommit(false); LargeObjectManager lom = ((PGConnection)conn.getInnermostDelegate()) .getLargeObjectAPI(); if (rs.getInt(column) != -1) { LargeObject lo = lom.open(rs.getInt(column)); return lo.getInputStream(); } else { return null; } }
public void deleteStream(JDBCStore store, Select sel) throws SQLException { JDBCFetchConfiguration fetch = store.getFetchConfiguration(); SQLBuffer sql = sel.toSelect(true, fetch); ResultSet res = null; DelegatingConnection conn = (DelegatingConnection) store.getConnection(); PreparedStatement stmnt = null; try { stmnt = sql.prepareStatement(conn, fetch, ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); setTimeouts(stmnt, fetch, true); res = stmnt.executeQuery(); if (!res.next()) { throw new InternalException(_loc.get("stream-exception")); } int oid = res.getInt(1); if (oid != -1) { conn.setAutoCommit(false); LargeObjectManager lom = getLargeObjectManager(conn); lom.delete(oid); } } finally { if (res != null) try { res.close (); } catch (SQLException e) {} if (stmnt != null) try { stmnt.close (); } catch (SQLException e) {} if (conn != null) try { conn.close (); } catch (SQLException e) {} } }
private void insertPostgresBlob(Row row, Column col, JDBCStore store, Object ob) throws SQLException { if (ob != null) { col.setType(Types.INTEGER); DelegatingConnection conn = (DelegatingConnection)store .getConnection(); try { conn.setAutoCommit(false); LargeObjectManager lom = getLargeObjectManager(conn); // The create method is valid in versions previous to 8.3 // in 8.3 this method is deprecated, use createLO int oid = lom.create(); LargeObject lo = lom.open(oid, LargeObjectManager.WRITE); OutputStream os = lo.getOutputStream(); copy((InputStream)ob, os); lo.close(); row.setInt(col, oid); } catch (IOException ioe) { throw new StoreException(ioe); } finally { conn.close(); } } else { row.setInt(col, -1); } }
private void insertPostgresBlob(Row row, Column col, JDBCStore store, Object ob) throws SQLException { if (ob != null) { col.setType(Types.INTEGER); DelegatingConnection conn = (DelegatingConnection)store .getConnection(); try { conn.setAutoCommit(false); LargeObjectManager lom = getLargeObjectManager(conn); // The create method is valid in versions previous to 8.3 // in 8.3 this method is deprecated, use createLO int oid = lom.create(); LargeObject lo = lom.open(oid, LargeObjectManager.WRITE); OutputStream os = lo.getOutputStream(); copy((InputStream)ob, os); lo.close(); row.setInt(col, oid); } catch (IOException ioe) { throw new StoreException(ioe); } finally { conn.close(); } } else { row.setInt(col, -1); } }
private void insertPostgresBlob(Row row, Column col, JDBCStore store, Object ob) throws SQLException { if (ob != null) { col.setType(Types.INTEGER); DelegatingConnection conn = (DelegatingConnection)store .getConnection(); try { conn.setAutoCommit(false); LargeObjectManager lom = getLargeObjectManager(conn); // The create method is valid in versions previous to 8.3 // in 8.3 this method is deprecated, use createLO int oid = lom.create(); LargeObject lo = lom.open(oid, LargeObjectManager.WRITE); OutputStream os = lo.getOutputStream(); copy((InputStream)ob, os); lo.close(); row.setInt(col, oid); } catch (IOException ioe) { throw new StoreException(ioe); } finally { conn.close(); } } else { row.setInt(col, -1); } }
private void insertPostgresBlob(Row row, Column col, JDBCStore store, Object ob) throws SQLException { if (ob != null) { col.setType(Types.INTEGER); DelegatingConnection conn = (DelegatingConnection)store .getConnection(); try { conn.setAutoCommit(false); LargeObjectManager lom = getLargeObjectManager(conn); // The create method is valid in versions previous to 8.3 // in 8.3 this method is deprecated, use createLO int oid = lom.create(); LargeObject lo = lom.open(oid, LargeObjectManager.WRITE); OutputStream os = lo.getOutputStream(); copy((InputStream)ob, os); lo.close(); row.setInt(col, oid); } catch (IOException ioe) { throw new StoreException(ioe); } finally { conn.close(); } } else { row.setInt(col, -1); } }
private void insertPostgresBlob(Row row, Column col, JDBCStore store, Object ob) throws SQLException { if (ob != null) { col.setType(Types.INTEGER); DelegatingConnection conn = (DelegatingConnection)store .getConnection(); try { conn.setAutoCommit(false); PGConnection pgconn = (PGConnection) conn.getInnermostDelegate(); LargeObjectManager lom = pgconn.getLargeObjectAPI(); // The create method is valid in versions previous 8.3 // in 8.3 this methos is deprecated, use createLO int oid = lom.create(); LargeObject lo = lom.open(oid, LargeObjectManager.WRITE); OutputStream os = lo.getOutputStream(); copy((InputStream)ob, os); lo.close(); row.setInt(col, oid); } catch (IOException ioe) { throw new StoreException(ioe); } finally { conn.close(); } } else { row.setInt(col, -1); } }