Package javax.ejb

Examples of javax.ejb.TransactionRolledbackLocalException


/*     */     {
/* 374 */       throw new TransactionRequiredLocalException(tre.getMessage());
/*     */     }
/*     */     catch (TransactionRolledbackException trbe)
/*     */     {
/* 378 */       throw new TransactionRolledbackLocalException(trbe.getMessage(), trbe);
/*     */     }
/*     */     finally
/*     */     {
/* 382 */       this.container.popENC();
/* 383 */       if (setCl)
View Full Code Here


/* 269 */         e = new JBossTransactionRolledbackLocalException(remoteTxRollback.getMessage(), cause);
/*     */       }
/*     */
/* 276 */       if ((!isLocal) && ((e instanceof TransactionRolledbackLocalException)))
/*     */       {
/* 278 */         TransactionRolledbackLocalException localTxRollback = (TransactionRolledbackLocalException)e;
/*     */
/* 280 */         e = new JBossTransactionRolledbackException(localTxRollback.getMessage(), localTxRollback.getCausedByException());
/*     */       }
/*     */
/* 285 */       Throwable cause = null;
/* 286 */       String exceptionType = null;
/* 287 */       if ((e instanceof TransactionRolledbackException))
View Full Code Here

        }
        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;
            }
        }
        if (e instanceof NoSuchObjectException) {
View Full Code Here

                transactionManager.setRollbackOnly();
            } catch ( Exception e ) {
    //FIXME: Use LogStrings.properties
    _logger.log(Level.FINEST, "", e);
      }
            throw new TransactionRolledbackLocalException("", ex);
        }
       
        // If the client's tx is going to rollback, it is fruitless
        // to invoke the EJB, so throw an exception back to client.
        if ( status == Status.STATUS_MARKED_ROLLBACK
                || status == Status.STATUS_ROLLEDBACK
                || status == Status.STATUS_ROLLING_BACK ) {
            throw new TransactionRolledbackLocalException("Client's transaction aborted");
        }
       
        container.validateEMForClientTx(inv, (JavaEETransaction) clientTx);

        if ( prevTx == null || prevStatus == Status.STATUS_NO_TRANSACTION ) {
            // First time the bean is running in this new client Tx
            EJBContextImpl context = (EJBContextImpl)inv.context;

            //Must change this for singleton
            if (! container.isSingleton) {
                context.setTransaction(clientTx);
            }
            try {
                transactionManager.enlistComponentResources();
               
                if ( !container.isStatelessSession && !container.isMessageDriven && !container.isSingleton) {
                    // Create a Synchronization object.
                   
                    // Not needed for stateless beans or message-driven beans
                    // or singletons because they cant have Synchronization callbacks,
                    // and they cant be associated with a tx across
                    // invocations.
                    // Register sync for methods other than finders/home methods
                    if ( !inv.invocationInfo.isHomeFinder ) {
                        ejbContainerUtilImpl.getContainerSync(clientTx).addBean(
                        context);
                    }
                   
                    container.afterBegin(context);
                }
            } catch (Exception ex) {
                try {
                    transactionManager.setRollbackOnly();
                } catch ( Exception e ) {
          //FIXME: Use LogStrings.properties
          _logger.log(Level.FINEST, "", e);
        }
                throw new TransactionRolledbackLocalException("", ex);
            }
        } else { // Bean already has a transaction associated with it.
            if ( !prevTx.equals(clientTx) ) {
                // There is already a different Tx in progress !!
                // Note: this can only happen for stateful SessionBeans.
                // EntityBeans will get a different context for every Tx.
                if ( container.isSession ) {
                    // Row 2 in Table E
                    throw new IllegalStateException(
                    "EJB is already associated with an incomplete transaction");
                }
            } else { // Bean was invoked again with the same transaction
                // This allows the TM to enlist resources used by the EJB
                // with the transaction
                try {
                    transactionManager.enlistComponentResources();
                } catch (Exception ex) {
                    try {
                        transactionManager.setRollbackOnly();
                    } catch ( Exception e ) {
                        //FIXME: Use LogStrings.properties
                        _logger.log(Level.FINEST, "", e);
          }
                    throw new TransactionRolledbackLocalException("", ex);
                }
            }
        }
     }
View Full Code Here

                container.forceDestroyBean(context);
            } finally {
                transactionManager.setRollbackOnly();
            }
            if ( exception instanceof Exception ) {
                newException = new TransactionRolledbackLocalException(
                  "Exception thrown from bean", (Exception)exception);
            } else {
                newException = new TransactionRolledbackLocalException(
                  "Exception thrown from bean: "+exception.toString());
                newException.initCause(exception);
            }
        } else if( isAppExceptionRequiringRollback(exception ) ) {
            transactionManager.setRollbackOnly();
View Full Code Here

    try {
      _ut.commit();
    } catch (RuntimeException e) {
      throw e;
    } catch (RollbackException e) {
      throw new TransactionRolledbackLocalException(e.getMessage(), e);
    } catch (HeuristicMixedException e) {
      throw new TransactionRolledbackLocalException(e.getMessage(), e);
    } catch (HeuristicRollbackException e) {
      throw new TransactionRolledbackLocalException(e.getMessage(), e);
    } catch (Exception e) {
      throw new EJBException(e);
    }
  }
View Full Code Here

      else
        _ut.rollback();
    } catch (RuntimeException e) {
      throw e;
    } catch (RollbackException e) {
      throw new TransactionRolledbackLocalException(e.getMessage(), e);
    } catch (HeuristicMixedException e) {
      throw new TransactionRolledbackLocalException(e.getMessage(), e);
    } catch (HeuristicRollbackException e) {
      throw new TransactionRolledbackLocalException(e.getMessage(), e);
    } catch (Exception e) {
      throw new EJBException(e);
    }
  }
View Full Code Here

TOP

Related Classes of javax.ejb.TransactionRolledbackLocalException

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.