public Throwable getRollbackCause() { beginOperation(true); try { if ((_flags & FLAG_ACTIVE) == 0) return null; javax.transaction.Transaction trans = _runtime.getTransactionManager().getTransaction(); if (trans == null) return null; if (trans.getStatus() == Status.STATUS_MARKED_ROLLBACK) return _runtime.getRollbackCause(); return null; } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new GeneralException(e); } finally { endOperation(); } }
try { ManagedRuntime mr = broker.getManagedRuntime(); TransactionManager tm = mr.getTransactionManager(); trans = tm.getTransaction(); if (trans != null Object txKey = mr.getTransactionKey(); Collection brokers = (Collection) _transactional.get(txKey);
public void setRollbackOnly(Throwable cause) throws Exception { // check to see if the runtime is cached if (_runtime == null) getTransactionManager(); if (_runtime != null) _runtime.setRollbackOnly(cause); }
public boolean getRollbackOnly() { beginOperation(true); try { if ((_flags & FLAG_ACTIVE) == 0) return false; javax.transaction.Transaction trans = _runtime.getTransactionManager().getTransaction(); if (trans == null) return false; return trans.getStatus() == Status.STATUS_MARKED_ROLLBACK; } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new GeneralException(e); } finally { endOperation(); } }
/** * Mark the current transaction as rollback-only. */ private void setRollbackOnlyInternal(Throwable cause) { try { javax.transaction.Transaction trans = _runtime.getTransactionManager().getTransaction(); if (trans == null) throw new InvalidStateException(_loc.get("null-trans")); // ensure tran is in a valid state to accept the setRollbackOnly int tranStatus = trans.getStatus(); if ((tranStatus != Status.STATUS_NO_TRANSACTION) && (tranStatus != Status.STATUS_ROLLEDBACK) && (tranStatus != Status.STATUS_COMMITTED)) _runtime.setRollbackOnly(cause); else if (_log.isTraceEnabled()) _log.trace(_loc.get("invalid-tran-status", Integer.valueOf( tranStatus), "setRollbackOnly")); } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new GeneralException(e); } }
protected Object currentInternal(JDBCStore store, ClassMapping mapping) throws Exception { if (current == null) { CurrentSequenceRunnable runnable = new CurrentSequenceRunnable(store, mapping); try { if (suspendInJTA()) { // NotSupportedException is wrapped in a StoreException by // the caller. _conf.getManagedRuntimeInstance().doNonTransactionalWork( runnable); } else { runnable.run(); } } catch (RuntimeException re) { throw (Exception) (re.getCause() == null ? re : re.getCause()); } } return super.currentInternal(store, mapping); }
public Throwable getRollbackCause() throws Exception { // check to see if the runtime is cached if (_runtime == null) getTransactionManager(); if (_runtime != null) return _runtime.getRollbackCause(); return null; }
public Object getTransactionKey() throws Exception, SystemException { if(_runtime == null) getTransactionManager(); if(_runtime != null ) return _runtime.getTransactionKey(); return null; }
public boolean getRollbackOnly() { beginOperation(true); try { if ((_flags & FLAG_ACTIVE) == 0) return false; javax.transaction.Transaction trans = _runtime.getTransactionManager().getTransaction(); if (trans == null) return false; return trans.getStatus() == Status.STATUS_MARKED_ROLLBACK; } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new GeneralException(e); } finally { endOperation(); } }
/** * Mark the current transaction as rollback-only. */ private void setRollbackOnlyInternal(Throwable cause) { try { javax.transaction.Transaction trans = _runtime.getTransactionManager().getTransaction(); if (trans == null) throw new InvalidStateException(_loc.get("null-trans")); // ensure tran is in a valid state to accept the setRollbackOnly int tranStatus = trans.getStatus(); if ((tranStatus != Status.STATUS_NO_TRANSACTION) && (tranStatus != Status.STATUS_ROLLEDBACK) && (tranStatus != Status.STATUS_COMMITTED)) _runtime.setRollbackOnly(cause); else if (_log.isTraceEnabled()) _log.trace(_loc.get("invalid-tran-status", Integer.valueOf( tranStatus), "setRollbackOnly")); } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new GeneralException(e); } }
protected Object currentInternal(JDBCStore store, ClassMapping mapping) throws Exception { if (current == null) { CurrentSequenceRunnable runnable = new CurrentSequenceRunnable(store, mapping); try { if (suspendInJTA()) { // NotSupportedException is wrapped in a StoreException by // the caller. _conf.getManagedRuntimeInstance().doNonTransactionalWork( runnable); } else { runnable.run(); } } catch (RuntimeException re) { throw (Exception) (re.getCause() == null ? re : re.getCause()); } } return super.currentInternal(store, mapping); }
public Throwable getRollbackCause() throws Exception { // check to see if the runtime is cached if (_runtime == null) getTransactionManager(); if (_runtime != null) return _runtime.getRollbackCause(); return null; }
public Object getTransactionKey() throws Exception, SystemException { if(_runtime == null) getTransactionManager(); if(_runtime != null ) return _runtime.getTransactionKey(); return null; }
Object txKey; try { trans = mr.getTransactionManager(). getTransaction(); txKey = mr.getTransactionKey();
public boolean getRollbackOnly() { beginOperation(true); try { if ((_flags & FLAG_ACTIVE) == 0) return false; javax.transaction.Transaction trans = _runtime.getTransactionManager().getTransaction(); if (trans == null) return false; return trans.getStatus() == Status.STATUS_MARKED_ROLLBACK; } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new GeneralException(e); } finally { endOperation(); } }
public Throwable getRollbackCause() { beginOperation(true); try { if ((_flags & FLAG_ACTIVE) == 0) return null; javax.transaction.Transaction trans = _runtime.getTransactionManager().getTransaction(); if (trans == null) return null; if (trans.getStatus() == Status.STATUS_MARKED_ROLLBACK) return _runtime.getRollbackCause(); return null; } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new GeneralException(e); } finally { endOperation(); } }
/** * Mark the current transaction as rollback-only. */ private void setRollbackOnlyInternal(Throwable cause) { try { javax.transaction.Transaction trans = _runtime.getTransactionManager().getTransaction(); if (trans == null) throw new InvalidStateException(_loc.get("null-trans")); // ensure tran is in a valid state to accept the setRollbackOnly int tranStatus = trans.getStatus(); if ((tranStatus != Status.STATUS_NO_TRANSACTION) && (tranStatus != Status.STATUS_ROLLEDBACK) && (tranStatus != Status.STATUS_COMMITTED)) _runtime.setRollbackOnly(cause); else if (_log.isTraceEnabled()) _log.trace(_loc.get("invalid-tran-status", Integer.valueOf( tranStatus), "setRollbackOnly")); } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new GeneralException(e); } }
protected Object currentInternal(JDBCStore store, ClassMapping mapping) throws Exception { if (current == null) { CurrentSequenceRunnable runnable = new CurrentSequenceRunnable(store, mapping); try { if (suspendInJTA()) { // NotSupportedException is wrapped in a StoreException by // the caller. _conf.getManagedRuntimeInstance().doNonTransactionalWork( runnable); } else { runnable.run(); } } catch (RuntimeException re) { throw (Exception) (re.getCause() == null ? re : re.getCause()); } } return super.currentInternal(store, mapping); }
public void setRollbackOnly(Throwable cause) throws Exception { // check to see if the runtime is cached if (_runtime == null) getTransactionManager(); if (_runtime != null) _runtime.setRollbackOnly(cause); }
public Throwable getRollbackCause() throws Exception { // check to see if the runtime is cached if (_runtime == null) getTransactionManager(); if (_runtime != null) return _runtime.getRollbackCause(); return null; }