Package javax.transaction

Examples of javax.transaction.SystemException


   public void resume(Transaction tobj) throws InvalidTransactionException,
                                               IllegalStateException,
                                               SystemException
   {
      if (!(tobj instanceof TransactionImpl))
         throw new SystemException();

      registry.assignTransaction((TransactionImpl)tobj);
   }
View Full Code Here


            // Wrap the error to give a reasonable stacktrace since the resource
            // could have been enlisted by a different thread
            if (enlistError == failedToEnlist)
            {
               throw new SystemException(bundle.systemExceptionWhenFailedToEnlistEqualsCurrentTx(
                     failedToEnlist, this.currentTx));
            }
            else
            {
               SystemException e = new SystemException(error);
               e.initCause(enlistError);
               throw e;
            }
         }
         if (!enlisted)
         {
View Full Code Here

                               SystemException
   {
      Transaction tx = registry.getTransaction();

      if (tx == null)
         throw new SystemException();

      if (tx.getStatus() == Status.STATUS_ROLLEDBACK ||
          tx.getStatus() == Status.STATUS_MARKED_ROLLBACK)
         throw new RollbackException();
View Full Code Here

            xares.start(xid, XAResource.TMNOFLAGS);
            status = Status.STATUS_ACTIVE;

        } catch (XAException e) {

            throw new SystemException("Unable to begin transaction: " +
                    "XA_ERR=" + e.errorCode);
        }
    }
View Full Code Here

            if (e.errorCode >= XAException.XA_RBBASE &&
                    e.errorCode <= XAException.XA_RBEND) {
                throw new RollbackException("Transaction rolled back: " +
                        "XA_ERR=" + e.errorCode);
            } else {
                throw new SystemException("Unable to commit transaction: " +
                        "XA_ERR=" + e.errorCode);
            }
        }
    }
View Full Code Here

            xares.rollback(xid);
            status = Status.STATUS_ROLLEDBACK;

        } catch (XAException e) {

            throw new SystemException("Unable to rollback transaction: " +
                    "XA_ERR=" + e.errorCode);
        }
    }
View Full Code Here

    @Test( expected = RuntimeException.class )
    public void beginWithSystemException()
        throws Exception
    {
        doThrow( new SystemException() ).when( txn ).begin();
        sut.begin();
    }
View Full Code Here

    @Test( expected = RuntimeException.class )
    public void commitWithSystemException()
        throws Exception
    {
        doThrow( new SystemException() ).when( txn ).commit();
        sut.commit();
    }
View Full Code Here

    @Test( expected = RuntimeException.class )
    public void rollbackWithSystemException()
        throws Exception
    {
        doThrow( new SystemException() ).when( txn ).rollback();
        sut.rollback();
    }
View Full Code Here

    @Test( expected = RuntimeException.class )
    public void setRollbackOnlyWithSystemException()
        throws Exception
    {
        doThrow( new SystemException() ).when( txn ).setRollbackOnly();
        sut.setRollbackOnly();
    }
View Full Code Here

TOP

Related Classes of javax.transaction.SystemException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.