5 Replies Latest reply on Jun 1, 2007 7:50 AM by lowecg2004

    A performance problem with Seam

    moises_paula


      There are a performance problem with Seam, after migration from 1.1.x to 1.2. One of interceptors, ManagedEntityIdentityInterceptor, for each method call in

      my backing bean, was calling Transactions.isTransactionMarkedRollback(...), that was trying to lookup for a name (userTransactionName). On tomcat, where

      there are no JNDI server started, I see a lot of javax.naming.CommunicationException in my logs. It's not a funtional problem, but it's degrading my

      performance for nothing. There are any option to disable that feature, removing the interceptor or caching an information that the lookup is not working?

      javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to

      connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:208)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1092)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:470)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:463)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at org.jboss.seam.util.Transactions.getUserTransaction(Transactions.java:149)
      at org.jboss.seam.util.Transactions.isUTTransactionMarkedRollback(Transactions.java:140)
      at org.jboss.seam.util.Transactions.isTransactionMarkedRollback(Transactions.java:67)

        • 1. Re: A performance problem with Seam
          bulloncito

           

          my backing bean, was calling Transactions.isTransactionMarkedRollback(...), that was trying to lookup for a name (userTransactionName). On tomcat, where

          there are no JNDI server started, I see a lot of javax.naming.CommunicationException in my logs.


          ... if there is a lookup, then there must be a jndi server started, otherwise transactionMakedRollback is probably useless

          • 2. Re: A performance problem with Seam
            bgrossi

             

            "bulloncito" wrote:
            my backing bean, was calling Transactions.isTransactionMarkedRollback(...), that was trying to lookup for a name (userTransactionName). On tomcat, where

            there are no JNDI server started, I see a lot of javax.naming.CommunicationException in my logs.


            ... if there is a lookup, then there must be a jndi server started, otherwise transactionMakedRollback is probably useless



            The Moises' problem was that the lookup and seam's transaction management IS "useless", and it's degrading performance considerably. We need an option to disable that (and other) features/interceptors... Now we have hardcoded in Component.initDefaultInterceptors():

            if ( getScope()==CONVERSATION )
            {
            addInterceptor( new Interceptor( new ManagedEntityIdentityInterceptor(), this ) );
            }


            and in ManagedEntityIdentityInterceptor.aroundInvoke(..) we have:
            ...
            finally
            {
            if ( !PassivatedEntity.isTransactionMarkedRollback() )
            {
            entityRefsToIds(ctx);
            }
            }


            That code (PassivatedEntity.isTransactionMarkedRollback()) was trying to lookup jndi, and returning false if it's fail... (the function is correct, but causes an try to open an socket!)


            Bruno E. Grossi


            • 3. Re: A performance problem with Seam
              bulloncito

              ... the problem is calling a Transaction from JNDI when there's not even a JNDI server, there will be no such managed transactions, maybe some configuration in persistence.xml to disable such transactions, maybe disabling JTA or something like that.

              • 4. Re: A performance problem with Seam
                lowecg2004

                Another angle on this... Do you have DOCTYPE defined for your pages.xml files?

                http://www.jboss.com/index.html?module=bb&op=viewtopic&t=109896

                • 5. Re: A performance problem with Seam
                  lowecg2004

                  sorry, meant to say "another angle on why you might be getting a performance degradation after migrating".

                  my post is nothing to do with interceptors/JDNI etc.