/** * Does nothing, since we don't do heuristics. */ @Override public void forget(Xid xid) throws XAException { throw new PGXAException(GT.tr("Heuristic commit/rollback not supported. forget xid={0}", xid), XAException.XAER_NOTA); }
/** * Does nothing, since we don't do heuristics, */ public void forget(Xid xid) throws XAException { throw new PGXAException(GT.tr("Heuristic commit/rollback not supported"), XAException.XAER_NOTA); }
throw new PGXAException(GT.tr("Invalid flags {0}", flags), XAException.XAER_INVAL); throw new PGXAException(GT.tr("xid must not be null"), XAException.XAER_INVAL); throw new PGXAException(GT.tr("tried to call end without corresponding start call. state={0}, start xid={1}, currentXid={2}, preparedXid={3}", state, xid, currentXid, preparedXid), XAException.XAER_PROTO); throw new PGXAException(GT.tr("suspend/resume not implemented"), XAException.XAER_RMERR);
/** * Preconditions: * 1. Flags is one of TMSUCCESS, TMFAIL, TMSUSPEND * 2. xid != null * 3. Connection is associated with transaction xid * * Implementation deficiency preconditions: * 1. Flags is not TMSUSPEND * * Postconditions: * 1. connection is disassociated from the transaction. */ public void end(Xid xid, int flags) throws XAException { if (logger.logDebug()) debug("ending transaction xid = " + xid); // Check preconditions if (flags != XAResource.TMSUSPEND && flags != XAResource.TMFAIL && flags != XAResource.TMSUCCESS) throw new PGXAException(GT.tr("Invalid flags"), XAException.XAER_INVAL); if (xid == null) throw new PGXAException(GT.tr("xid must not be null"), XAException.XAER_INVAL); if (state != STATE_ACTIVE || !currentXid.equals(xid)) throw new PGXAException(GT.tr("tried to call end without corresponding start call"), XAException.XAER_PROTO); // Check implementation deficiency preconditions if (flags == XAResource.TMSUSPEND) throw new PGXAException(GT.tr("suspend/resume not implemented"), XAException.XAER_RMERR); // We ignore TMFAIL. It's just a hint to the RM. We could roll back immediately // if TMFAIL was given. // All clear. We don't have any real work to do. state = STATE_ENDED; }
throw new PGXAException(GT.tr("Invalid flags {0}", flag), XAException.XAER_INVAL); throw new PGXAException(GT.tr("Error during recover"), ex, XAException.XAER_RMERR);
throw new PGXAException(GT.tr("Invalid flag"), XAException.XAER_INVAL); throw new PGXAException(GT.tr("Error during recover"), ex, XAException.XAER_RMERR);
throw new PGXAException(GT.tr("Not implemented: one-phase commit must be issued using the same connection that was used to start it"), XAException.XAER_RMERR); throw new PGXAException(GT.tr("commit called before end"), XAException.XAER_PROTO); throw new PGXAException(GT.tr("Error during one-phase commit"), ex, XAException.XAER_RMERR);
throw new PGXAException(GT.tr("One-phase commit called for xid {0} but connection was prepared with xid {1}", xid, preparedXid), XAException.XAER_PROTO); throw new PGXAException(GT.tr( "Not implemented: one-phase commit must be issued using the same connection that was used to start it", xid), XAException.XAER_RMERR); throw new PGXAException(GT.tr("One-phase commit with unknown xid. commit xid={0}, currentXid={1}", xid, currentXid), XAException.XAER_NOTA); throw new PGXAException(GT.tr("commit called before end. commit xid={0}, state={1}", xid, state), XAException.XAER_PROTO); conn.setAutoCommit(localAutoCommitMode); } catch (SQLException ex) { throw new PGXAException(GT.tr("Error during one-phase commit. commit xid={0}", xid), ex, mapSQLStateToXAErrorCode(ex));
@Override public void commit(Xid xid, boolean onePhase) throws XAException { if (LOGGER.isLoggable(Level.FINEST)) { debug("committing xid = " + xid + (onePhase ? " (one phase) " : " (two phase)")); } if (xid == null) { throw new PGXAException(GT.tr("xid must not be null"), XAException.XAER_INVAL); } if (onePhase) { commitOnePhase(xid); } else { commitPrepared(xid); } }
throw new PGXAException(GT.tr("Invalid flags {0}", flags), XAException.XAER_INVAL); throw new PGXAException(GT.tr("xid must not be null"), XAException.XAER_INVAL); throw new PGXAException(GT.tr("Connection is busy with another transaction"), XAException.XAER_PROTO); throw new PGXAException(GT.tr("suspend/resume not implemented"), XAException.XAER_RMERR); throw new PGXAException( GT.tr( "Invalid protocol state requested. Attempted transaction interleaving is not supported. xid={0}, currentXid={1}, state={2}, flags={3}", throw new PGXAException( GT.tr( "Invalid protocol state requested. Attempted transaction interleaving is not supported. xid={0}, currentXid={1}, state={2}, flags={3}", throw new PGXAException(GT.tr("Invalid protocol state requested. Attempted transaction interleaving is not supported. xid={0}, currentXid={1}, state={2}, flags={3}", xid, currentXid, state, flags), XAException.XAER_RMERR); conn.setAutoCommit(false); } catch (SQLException ex) { throw new PGXAException(GT.tr("Error disabling autocommit"), ex, XAException.XAER_RMERR);
throw new PGXAException(GT.tr("Invalid flags"), XAException.XAER_INVAL); throw new PGXAException(GT.tr("xid must not be null"), XAException.XAER_INVAL); throw new PGXAException(GT.tr("Connection is busy with another transaction"), XAException.XAER_PROTO); throw new PGXAException(GT.tr("suspend/resume not implemented"), XAException.XAER_RMERR); throw new PGXAException(GT.tr("Transaction interleaving not implemented"), XAException.XAER_RMERR); throw new PGXAException(GT.tr("Transaction interleaving not implemented"), XAException.XAER_RMERR); } else if(state == STATE_ENDED) throw new PGXAException(GT.tr("Transaction interleaving not implemented"), XAException.XAER_RMERR); throw new PGXAException(GT.tr("Error disabling autocommit"), ex, XAException.XAER_RMERR);
+ " while it was prepared in past with prepared xid " + preparedXid); throw new PGXAException(GT.tr( "Preparing already prepared transaction, the prepared xid {0}, prepare xid={1}", preparedXid, xid), XAException.XAER_PROTO); } else if (currentXid == null) { throw new PGXAException(GT.tr( "Current connection does not have an associated xid. prepare xid={0}", xid), XAException.XAER_NOTA); debug("Error to prepare xid " + xid + ", the current connection already bound with xid " + currentXid); throw new PGXAException(GT.tr( "Not implemented: Prepare must be issued using the same connection that started the transaction. currentXid={0}, prepare xid={1}", currentXid, xid), XAException.XAER_RMERR); throw new PGXAException(GT.tr("Prepare called before end. prepare xid={0}, state={1}", xid), XAException.XAER_INVAL); throw new PGXAException(GT.tr("Error preparing transaction. prepare xid={0}", xid), ex, mapSQLStateToXAErrorCode(ex));
throw new PGXAException(GT.tr("Not implemented: Prepare must be issued using the same connection that started the transaction"), XAException.XAER_RMERR); throw new PGXAException(GT.tr("Prepare called before end"), XAException.XAER_INVAL); throw new PGXAException(GT.tr("Server versions prior to 8.1 do not support two-phase commit."), XAException.XAER_RMERR); throw new PGXAException(GT.tr("Error preparing transaction"), ex, XAException.XAER_RMERR);
throw new PGXAException(GT.tr("Error rolling back prepared transaction. rollback xid={0}, preparedXid={1}, currentXid={2}", xid, preparedXid), ex, errorCode);
throw new PGXAException( GT.tr("Not implemented: 2nd phase commit must be issued using an idle connection. commit xid={0}, currentXid={1}, state={2], transactionState={3}", xid, currentXid, state, conn.getTransactionState()), XAException.XAER_RMERR); throw new PGXAException(GT.tr("Error committing prepared transaction. commit xid={0}, preparedXid={1}, currentXid={2}", xid, preparedXid, currentXid), ex, errorCode);
public void commit(Xid xid, boolean onePhase) throws XAException { if (logger.logDebug()) debug("committing xid = " + xid + (onePhase ? " (one phase) " : " (two phase)")); if (xid == null) throw new PGXAException(GT.tr("xid must not be null"), XAException.XAER_INVAL); if (onePhase) commitOnePhase(xid); else commitPrepared(xid); }
throw new PGXAException(GT.tr("Not implemented: 2nd phase commit must be issued using an idle connection"), XAException.XAER_RMERR); throw new PGXAException(GT.tr("Error committing prepared transaction"), ex, XAException.XAER_RMERR);
throw new PGXAException(GT.tr("Error rolling back prepared transaction"), ex, XAException.XAER_RMERR);
/** * Does nothing, since we don't do heuristics, */ public void forget(Xid xid) throws XAException { throw new PGXAException(GT.tr("Heuristic commit/rollback not supported"), XAException.XAER_NOTA); }
public void commit(Xid xid, boolean onePhase) throws XAException { if (logger.logDebug()) debug("committing xid = " + xid + (onePhase ? " (one phase) " : " (two phase)")); if (xid == null) throw new PGXAException(GT.tr("xid must not be null"), XAException.XAER_INVAL); if (onePhase) commitOnePhase(xid); else commitPrepared(xid); }