1 Reply Latest reply on Aug 28, 2009 12:27 AM by luxspes

    EJB 3 vs. JavaBean components

    asookazian

      Most likely discussed previously, but I'm wondering what's going to happen with EE 6 and EJB 3.1 and whether or not this will make any difference for Seam developers (like Francisco who just seems to love EJB 3 ;)


      I hit a brick wall the last couple days for a particular transactional requirement that I could not implement/satisfy using JavaBeans and @Transactional.


      Here's some detail: https://jira.jboss.org/jira/browse/JBSEAM-4391


      Is it more than likely that EJB 3.1 components will not be able to be incrementally hot deployed as well (even though the interface is no longer required)?


      I've learned recently that Seam interceptors are a good substitute for intercepting JavaBean public methods.


      But the tx support with the Seam API is lacking the ability to suspend tx's:


      /**
       * Transaction propagation strategies for Seam JavaBean 
       * components. Note that unlike EJB3 components, there 
       * are no strategies for suspending transactions.
       * 
       * @author Gavin King
       *
       */
      public enum TransactionPropagationType
      {
         REQUIRED,
         MANDATORY, 
         SUPPORTS,
         NEVER;
         
         public boolean isNewTransactionRequired(boolean transactionActive)
         {
            switch (this)
            {
               case REQUIRED:
                  return !transactionActive;
               case SUPPORTS:
                  return false;
               case MANDATORY:
                  if ( !transactionActive )
                  {
                     throw new IllegalStateException("No transaction active on call to MANDATORY method");
                  }
                  else
                  {
                     return false;
                  }
               case NEVER:
                  if ( transactionActive )
                  {
                     throw new IllegalStateException("Transaction active on call to NEVER method");
                  }
                  else
                  {
                     return false;
                  }
               default:
                  throw new IllegalArgumentException();
            }
         }
         
      }



      So I'm wondering whether this will be fixed in Seam 3 or will we be able to hot deploy EJB 3.1 components in Seam 3?


      And yes, I know about JavaRebel, but IIRC that only allows you to hot deploy changes to an existing method (but no signature changes, etc.)

        • 1. Re: EJB 3 vs. JavaBean components

          Arbi Sookazian wrote on Aug 27, 2009 22:47:


          Most likely discussed previously, but I'm wondering what's going to happen with EE 6 and EJB 3.1 and whether or not this will make any difference for Seam developers (like Francisco who just seems to love EJB 3 ;)


          LOL!