public final static void updateAssociation (ControlWrapper tx, int reason) { ThreadAssociations.updateAssociation(tx, reason); }
protected AtomicTransaction (ControlWrapper tx) { if (jtsLogger.logger.isTraceEnabled()) { jtsLogger.logger.trace("AtomicTransaction::AtomicTransaction ()"); } _theAction = tx; _theStatus = getStatus(); /* * Once a transaction is created there is no way to get its timeout. So, * we use the timeout associated with the current thread, since that is * most likely to be the right value. */ _timeout = get_timeout(); }
public static final int nameToXID (String name) { if (name == null) return -1; else { if (name.compareTo(Arjuna.arjunaXID()) == 0) return Arjuna.XID(); else { if (name.compareTo(Arjuna.arjunaStrictXID()) == 0) return Arjuna.strictXID(); else { if (name.compareTo(Arjuna.arjunaRestrictedXID()) == 0) return Arjuna.restrictedXID(); else { if (name.compareTo(Arjuna.osiXID()) == 0) return 0; // osi tp else return -1; } } } } }
public void finalize () { if (jtsLogger.logger.isTraceEnabled()) { jtsLogger.logger.trace("AtomicTransaction.finalize ()"); } if (_theAction != null) { if (getStatus() == Status.StatusActive) { jtsLogger.i18NLogger.warn_extensions_atscope("AtomicTransaction.finalize", get_uid()); String name = null; try { name = get_transaction_name(); } catch (SystemException ex) { jtsLogger.i18NLogger.warn_extensions_namefail(ex); } try { rollback(); // tidies up for us. } catch (NoTransaction e) { jtsLogger.i18NLogger.warn_extensions_abortfailnoexist(name); } catch (Exception e) { jtsLogger.i18NLogger.warn_extensions_abortfail(name); } } } }
public synchronized void commit (boolean report_heuristics) throws SystemException, NoTransaction, HeuristicMixed, HeuristicHazard, WrongTransaction { if (jtsLogger.logger.isTraceEnabled()) { jtsLogger.logger.trace("TopLevelTransaction::commit ( " + report_heuristics + " ) called for " + _originalTransaction); } if (validTransaction()) { try { super.commit(report_heuristics); } catch (WrongTransaction e1) { resumeTransaction(); throw e1; } catch (SystemException e2) { resumeTransaction(); throw e2; } resumeTransaction(); } else throw new WrongTransaction(); }
public synchronized void rollback () throws SystemException, NoTransaction, WrongTransaction { if (jtsLogger.logger.isTraceEnabled()) { jtsLogger.logger.trace("TopLevelTransaction::rollback () called for " + _originalTransaction); } if (validTransaction()) { try { super.rollback(); } catch (WrongTransaction e1) { resumeTransaction(); throw e1; } catch (SystemException e2) { resumeTransaction(); throw e2; } resumeTransaction(); } else throw new WrongTransaction(); }
public FactoryList () { FactoryList.add(new InterpositionCreator(), Arjuna.XID()); FactoryList.add(new StrictInterpositionCreator(), Arjuna.strictXID()); FactoryList.add(new RestrictedInterpositionCreator(), Arjuna.restrictedXID()); FactoryList.add(new OSIInterpositionCreator(), 0); // 0 is OSI TP! FactoryList.addDefault(new OSIInterpositionCreator(), 0); // 0 is OSI // TP! }
/** * Create a new transaction. It is not running at this stage. */ public AtomicTransaction () { if (jtsLogger.logger.isTraceEnabled()) { jtsLogger.logger.trace("AtomicTransaction::AtomicTransaction ()"); } _theAction = null; _theStatus = Status.StatusNoTransaction; _timeout = get_timeout(); }
/** * @return the status of this transaction. */ public org.omg.CosTransactions.Status get_status () throws SystemException { _theStatus = getStatus(); if (jtsLogger.logger.isTraceEnabled()) { jtsLogger.logger.trace("AtomicTransaction::get_status called for " + _theAction + " returning " + Utility.stringStatus(_theStatus)); } return _theStatus; }
public ControlWrapper suspendWrapper () throws SystemException { if (jtsLogger.logger.isTraceEnabled()) { jtsLogger.logger.trace("CurrentImple::suspendWrapper ()"); } ControlWrapper actPtr = _theManager.popAction(); if (actPtr == null) { ThreadAssociationControl.updateAssociation(null, TX_SUSPENDED); return null; } else { ThreadAssociationControl.updateAssociation(actPtr, TX_SUSPENDED); /* * Purge the remaining controls from the thread context. If the * controls are remote and proxies then we delete them here, since * we must recreate them next time we want to use them anyway. */ _theManager.purgeActions(); return actPtr; } }
public synchronized void commit (boolean report_heuristics) throws SystemException, NoTransaction, HeuristicMixed, HeuristicHazard, WrongTransaction { if (jtsLogger.logger.isDebugEnabled()) { jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "TopLevelTransaction::commit ( "+report_heuristics+" ) called for "+_originalTransaction); } if (validTransaction()) { try { super.commit(report_heuristics); } catch (WrongTransaction e1) { resumeTransaction(); throw e1; } catch (SystemException e2) { resumeTransaction(); throw e2; } resumeTransaction(); } else throw new WrongTransaction(); }
public synchronized void rollback () throws SystemException, NoTransaction, WrongTransaction { if (jtsLogger.logger.isDebugEnabled()) { jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "TopLevelTransaction::rollback () called for "+_originalTransaction); } if (validTransaction()) { try { super.rollback(); } catch (WrongTransaction e1) { resumeTransaction(); throw e1; } catch (SystemException e2) { resumeTransaction(); throw e2; } resumeTransaction(); } else throw new WrongTransaction(); }
public FactoryList () { FactoryList.add(new InterpositionCreator(), Arjuna.XID()); FactoryList.add(new StrictInterpositionCreator(), Arjuna.strictXID()); FactoryList.add(new RestrictedInterpositionCreator(), Arjuna.restrictedXID()); FactoryList.add(new OSIInterpositionCreator(), 0); // 0 is OSI TP! FactoryList.addDefault(new OSIInterpositionCreator(), DEFAULT_ID); // 0 is OSI TP! }
protected AtomicTransaction (ControlWrapper tx) { if (jtsLogger.logger.isDebugEnabled()) { jtsLogger.logger.debug(DebugLevel.CONSTRUCTORS, VisibilityLevel.VIS_PUBLIC, com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "AtomicTransaction::AtomicTransaction ()"); } _theAction = tx; _theStatus = getStatus(); /* * Once a transaction is created there is no way to get its timeout. So, * we use the timeout associated with the current thread, since that is * most likely to be the right value. */ _timeout = get_timeout(); }
public final static void updateAssociation (ControlWrapper tx, int reason) { ThreadAssociations.updateAssociation(tx, reason); }
/** * Create a new transaction. It is not running at this stage. */ public AtomicTransaction () { if (jtsLogger.logger.isDebugEnabled()) { jtsLogger.logger.debug(DebugLevel.CONSTRUCTORS, VisibilityLevel.VIS_PUBLIC, com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "AtomicTransaction::AtomicTransaction ()"); } _theAction = null; _theStatus = Status.StatusNoTransaction; _timeout = get_timeout(); }
/** * @return the status of this transaction. */ public org.omg.CosTransactions.Status get_status () throws SystemException { _theStatus = getStatus(); if (jtsLogger.logger.isDebugEnabled()) { jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "AtomicTransaction::get_status called for " + _theAction + " returning " + Utility.stringStatus(_theStatus)); } return _theStatus; }
public ControlWrapper suspendWrapper () throws SystemException { if (jtsLogger.logger.isDebugEnabled()) { jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "CurrentImple::suspendWrapper ()"); } ControlWrapper actPtr = _theManager.popAction(); if (actPtr == null) { ThreadAssociationControl.updateAssociation(null, TX_SUSPENDED); return null; } else { ThreadAssociationControl.updateAssociation(actPtr, TX_SUSPENDED); /* * Purge the remaining controls from the thread context. If the * controls are remote and proxies then we delete them here, since * we must recreate them next time we want to use them anyway. */ _theManager.purgeActions(); return actPtr; } }