_tx.commit(); } catch (Exception e) { if (_logger.isLoggable(Level.SEVERE)) {
/** * @see org.springmodules.transaction.support.AbstractPlatformTransactionManager#doCommit(org.springmodules.transaction.support.DefaultTransactionStatus) */ protected void doCommit(DefaultTransactionStatus status) throws TransactionException { JiniTransactionObject txObject = (JiniTransactionObject) status .getTransaction(); if (logger.isDebugEnabled()) logger.debug("Committing Jini transaction " + txObject.toString()); try { txObject.getTransaction().commit(); } catch (UnknownTransactionException e) { throw convertJiniException(e); } catch (CannotCommitException e) { throw convertJiniException(e); } catch (RemoteException e) { throw convertJiniException(e); } }
/** * Commits the transaction if it was forced by the query. */ private void commitForcedTransaction(Query query, QuerySession session) throws UnknownTransactionException, CannotCommitException, RemoteException { if (session.isAutoCommit() && query.isForceUnderTransaction()) { session.getTransaction().commit(); session.setSelectedForUpdate(null); session.setTransaction(null); } }
public ResponsePacket executeOnSpace(ISpaceProxy space, Transaction txn) throws SQLException { ResponsePacket packet = new ResponsePacket(); try { if (txn != null) { if (isCommit) { if (session.isAutoCommit()) throw new SQLException("Cannot commit an autocommit connection", "GSP", -139); txn.commit(Long.MAX_VALUE); } else { if (session.isAutoCommit()) throw new SQLException("Cannot rollback an autocommit connection", "GSP", -140); txn.abort(Long.MAX_VALUE); } } //anyways session.setSelectedForUpdate(null); session.setTransaction(null); packet.setIntResult(0); } catch (Exception e) { SQLException se = new SQLException((isCommit ? "Commit" : "Rollback") + " failed; Cause: " + e); se.initCause(e); throw se; } return packet; }