Package javax.ejb

Examples of javax.ejb.EJBTransactionRolledbackException


            throw new EJBException("Cannot discard the bean", pe);
        }

        // Throw javax.ejb.EJBTransactionRolledbackException to
        // client.
        EJBTransactionRolledbackException transactionException = new EJBTransactionRolledbackException(
                "System exception, The transaction has been marked for rollback only");
        transactionException.initCause(e);
        throw transactionException;
    }
View Full Code Here


  public void rethrowEjbException(Exception e, boolean isClientXa)
  {
    if (isClientXa) {
      RuntimeException exn;
     
      exn = new EJBTransactionRolledbackException(e.getMessage(), e);
     
      throw exn;
    }
    else if (e instanceof EJBException)
      throw (RuntimeException) e;
View Full Code Here

  public void rethrowEjbException(Error e, boolean isClientXa)
  {
    if (isClientXa) {
      RuntimeException exn;
     
      exn = new EJBTransactionRolledbackException(e.getMessage());
      exn.initCause(e);
     
      throw exn;
    }
    else {
View Full Code Here

                return e;
            }
        }
        if (e instanceof TransactionRolledbackException) {
            if (!rmiRemote && interfaceType.isBusiness()) {
                return new EJBTransactionRolledbackException(e.getMessage()).initCause(getCause(e));
            } else if (interfaceType.isLocal()) {
                return new TransactionRolledbackLocalException(e.getMessage()).initCause(getCause(e));
            } else {
                return e;
            }
View Full Code Here

      // if it's not EJBTransactionRolledbackException
      if(!(t instanceof EJBTransactionRolledbackException))
      {
         if(t instanceof Error)
         {
            t = new EJBTransactionRolledbackException(formatException("Unexpected Error", t));
         }
         else if(t instanceof RuntimeException || t instanceof RemoteException)
         {
            t = new EJBTransactionRolledbackException(t.getMessage(), (Exception) t);
         }
         else // application exception
         {
            throw t;
         }
View Full Code Here

                return e;
            }
        }
        if (e instanceof TransactionRolledbackException) {
            if (!rmiRemote && interfaceType.isBusiness()) {
                return new EJBTransactionRolledbackException(e.getMessage()).initCause(getCause(e));
            } else if (interfaceType.isLocal()) {
                return new TransactionRolledbackLocalException(e.getMessage()).initCause(getCause(e));
            } else {
                return e;
            }
View Full Code Here

   protected void handleEndTransactionException(Exception e)
   {
      if (e instanceof RollbackException)
      {
         throw new EJBTransactionRolledbackException("Transaction rolled back", e);
      }
      throw new EJBException(e);
   }
View Full Code Here

      {
         if (t instanceof Error)
         {
            //t = new EJBTransactionRolledbackException(formatException("Unexpected Error", t));
            Throwable cause = t;
            t = new EJBTransactionRolledbackException("Unexpected Error");
            t.initCause(cause);
         }
         // If this is an EJBException, pass through to the caller
         else if (t instanceof EJBException || t instanceof RemoteException)
         {
            // Leave Exception as-is (this is in place to handle specifically, and not
            // as a generic RuntimeException
         }
         else if (t instanceof RuntimeException)
         {
            t = new EJBTransactionRolledbackException(t.getMessage(), (Exception) t);
         }
         else // application exception
         {
            throw (Exception) t;
         }
View Full Code Here

        return 0;
    }

    protected void handleEndTransactionException(Exception e) {
        if (e instanceof RollbackException)
            throw new EJBTransactionRolledbackException("Transaction rolled back", e);
        throw new EJBException(e);
    }
View Full Code Here

        // if it's not EJBTransactionRolledbackException
        if (!(t instanceof EJBTransactionRolledbackException)) {
            if (t instanceof Error) {
                //t = new EJBTransactionRolledbackException(formatException("Unexpected Error", t));
                Throwable cause = t;
                t = new EJBTransactionRolledbackException("Unexpected Error");
                t.initCause(cause);
            } else if (t instanceof NoSuchEJBException) {
                // If this is an NoSuchEJBException, pass through to the caller

            } else if (t instanceof RuntimeException) {
                t = new EJBTransactionRolledbackException(t.getMessage(), (Exception) t);
            } else {// application exception
                throw (Exception) t;
            }
        }
View Full Code Here

TOP

Related Classes of javax.ejb.EJBTransactionRolledbackException

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.