User: fleury  
  Date: 00/08/24 19:05:13

  Modified:    src/main/org/jboss/ejb/plugins TxInterceptor.java
  Log:
   we change the default behaviour to "required"
  
  Revision  Changes    Path
  1.14      +13 -9     jboss/src/main/org/jboss/ejb/plugins/TxInterceptor.java
  
  Index: TxInterceptor.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/TxInterceptor.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- TxInterceptor.java        2000/08/18 03:20:57     1.13
  +++ TxInterceptor.java        2000/08/25 02:05:13     1.14
  @@ -38,7 +38,7 @@
   *   @see <related>
   *   @author Rickard �berg ([EMAIL PROTECTED])
   *   @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
  -*   @version $Revision: 1.13 $
  +*   @version $Revision: 1.14 $
   */
   public class TxInterceptor
   extends AbstractInterceptor
  @@ -139,11 +139,11 @@
           // New transaction is the new transaction this might start
          Transaction newTransaction = null;
          
  -//       Logger.log("Current transaction in MI is "+mi.getTransaction()); 
  -//       Logger.log("Current method "+mi.getMethod());           
  +//DEBUG       Logger.log("Current transaction in MI is "+mi.getTransaction()); 
  +//DEBUG       Logger.log("Current method "+mi.getMethod().getName());           
          byte transType = getTransactionMethod(mi.getMethod(), remoteInvocation);
   
  -// DEBUG     printMethod(mi.getMethod(), transType);
  +     printMethod(mi.getMethod(), transType);
          
          switch (transType) {
            
  @@ -165,7 +165,7 @@
                 
             if (oldTransaction == null) { // No tx running
                    
  -              //DEBUG               Logger.debug("Begin tx");
  +              Logger.debug("Begin tx");
                    
                 // Create tx 
                 tm.begin();
  @@ -219,13 +219,16 @@
             } 
             
             finally {
  -              
  +            
  +                      //DEBUG Logger.log("In finally");
  +                       
                 // Only do something if we started the transaction
                 if (newTransaction != null) {
                    
                    // Marked rollback
                    if (newTransaction.getStatus() == Status.STATUS_MARKED_ROLLBACK) {
                 
  +                                     Logger.log("rolling back");     
                      // actually roll it back 
                      newTransaction.rollback();
                    }
  @@ -233,6 +236,7 @@
                    //Still running
                    else if(newTransaction.getStatus() == Status.STATUS_ACTIVE) {
                      
  +                                Logger.log("commiting");
                      // Commit tx
                      // This will happen if
                      // a) everything goes well
  @@ -243,7 +247,7 @@
                    // reassociate the oldTransaction with the methodInvocation (even 
null)
                    mi.setTransaction(oldTransaction);
                 }
  -          }
  +             }
            }
             
            case MetaData.TX_SUPPORTS: {
  @@ -373,11 +377,11 @@
          if(b != null) return b.byteValue();
            
          BeanMetaData bmd = container.getBeanMetaData();
  -       Logger.log("Found metadata for bean '"+bmd.getEjbName()+"'"+" method is 
"+m.getName());
  +       //DEBUG Logger.log("Found metadata for bean '"+bmd.getEjbName()+"'"+" method 
is "+m.getName());
          byte result = bmd.getMethodTransactionType(m.getName(), 
m.getParameterTypes(), remoteInvocation);
          
          // provide default if method is not found in descriptor 
  -       if (result == MetaData.TX_UNKNOWN) result = MetaData.TX_SUPPORTS;
  +       if (result == MetaData.TX_UNKNOWN) result = MetaData.TX_REQUIRED;
          
          methodTx.put(m, new Byte(result));
          return result;
  
  
  

Reply via email to