@Override public RDFBeanTransaction beginTransaction(boolean readOnly, int txTimeout, int isolationLevel) { if (transaction != null) { throw new IllegalStateException("Transaction exists already"); } transaction = connection.beginTransaction(readOnly, txTimeout, isolationLevel); return transaction; }
@Override public RDFBeanTransaction beginTransaction(boolean readOnly, int txTimeout, int isolationLevel) { RDFBeanTransaction[] transactions = new RDFBeanTransaction[connections.length]; for (int i = 0; i < transactions.length; i++) { transactions[i] = connections[i].beginTransaction(readOnly, txTimeout, isolationLevel); } this.readonlyTnx = readOnly; localTxn = new MultiTransaction(this, transactions); return localTxn; }
@Override public <RT> RT execute(RDFConnectionCallback<RT> operation) { RDFConnection connection = openConnection(); try { RDFBeanTransaction tx = connection.beginTransaction(false, RDFBeanTransaction.TIMEOUT, RDFBeanTransaction.ISOLATION); try { RT retVal = operation.doInConnection(connection); tx.commit(); return retVal; } catch (IOException io) { tx.rollback(); throw new RepositoryException(io); } } finally { connection.close(); } }
@Override public <RT> RT execute(RDFConnectionCallback<RT> operation) { RDFConnection connection = openConnection(); try{ RDFBeanTransaction tx = connection.beginTransaction(false, RDFBeanTransaction.TIMEOUT, RDFBeanTransaction.ISOLATION); try{ RT retVal = operation.doInConnection(connection); tx.commit(); return retVal; }catch(IOException io){ tx.rollback(); throw new RepositoryException(io); } }finally{ connection.close(); } }
@Override public <RT> RT execute(RDFConnectionCallback<RT> operation) { RDFConnection connection = openConnection(); try { RDFBeanTransaction tx = connection.beginTransaction(false, RDFBeanTransaction.TIMEOUT, RDFBeanTransaction.ISOLATION); try { RT retVal = operation.doInConnection(connection); tx.commit(); return retVal; } catch (IOException io) { tx.rollback(); throw new RepositoryException(io); } } finally { connection.close(); } }