1 2 Previous Next 21 Replies Latest reply on May 28, 2008 4:06 PM by graben Go to original post
      • 15. Re: Seam Manager Persistence
        pmuir

        Show your components.xml

        • 16. Re: Seam Manager Persistence
          graben
          <?xml version="1.0" encoding="UTF-8"?>
          <components xmlns="http://jboss.com/products/seam/components"
               xmlns:core="http://jboss.com/products/seam/core"
               xmlns:international="http://jboss.com/products/seam/international"
               xmlns:persistence="http://jboss.com/products/seam/persistence"
               xmlns:security="http://jboss.com/products/seam/security"
               xmlns:theme="http://jboss.com/products/seam/theme"
               xmlns:transaction="http://jboss.com/products/seam/transaction"
               xmlns:web="http://jboss.com/products/seam/web"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://jboss.com/products/seam/components   http://jboss.com/products/seam/components-2.0.xsd   http://jboss.com/products/seam/core   http://jboss.com/products/seam/core-2.0.xsd   http://jboss.com/products/seam/international   http://jboss.com/products/seam/international-2.0.xsd   http://jboss.com/products/seam/mail   http://jboss.com/products/seam/mail-2.0.xsd   http://jboss.com/products/seam/persistence   http://jboss.com/products/seam/persistence-2.0.xsd   http://jboss.com/products/seam/security   http://jboss.com/products/seam/security-2.0.xsd   http://jboss.com/products/seam/theme   http://jboss.com/products/seam/theme-2.0.xsd   http://jboss.com/products/seam/transaction   http://jboss.com/products/seam/transaction-2.0.xsd http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.0.xsd">
               <core:init debug="@debug@" jndi-pattern="@jndiPattern@" />
               <core:manager concurrent-request-timeout="500"
                    conversation-id-parameter="cid" conversation-timeout="1800000" />
               <core:resource-loader>
                    <core:bundle-names>
                         <value>messages</value>
                         <value>labels</value>
                         <value>common</value>
                         <value>argon</value>
                    </core:bundle-names>
               </core:resource-loader>
               <event type="org.jboss.seam.security.notLoggedIn">
                    <action execute="#{redirect.captureCurrentView}" />
               </event>
               <event type="org.jboss.seam.security.postAuthenticate">
                    <action execute="#{redirect.returnToCapturedView}" />
               </event>
               <international:locale-selector cookie-enabled="true" />
               <persistence:managed-persistence-context auto-create="true"
                    name="entityManager"
                    persistence-unit-jndi-name="java:/@projectname@EntityManagerFactory" />
               <security:identity
                    authenticate-method="#{authenticator.authenticate}"
                    remember-me="true" />
               <theme:theme-selector cookie-enabled="true"
                    name="org.jboss.seam.theme.themeSelector">
                    <theme:available-themes>
                         <value>argon2_1024</value>
                         <value>argon2_1280</value>
                    </theme:available-themes>
               </theme:theme-selector>
               <transaction:ejb-transaction />
               <web:ajax4jsf-filter force-parser="false" />
               <factory auto-create="true" name="auditManager" scope="CONVERSATION"
                    value="#{de.lbb.argon2.audit.AuditManager}" />
               <factory auto-create="true" name="basePath" scope="CONVERSATION"
                    value="#{facesContext.externalContext.request.scheme}://#{facesContext.externalContext.request.serverName}:#{facesContext.externalContext.request.serverPort}#{facesContext.externalContext.request.contextPath}" />
               <factory name="sessionTimeoutSeconds" scope="SESSION"
                    value="#{facesContext.externalContext.getSession(true).getMaxInactiveInterval()}" />
          </components>


          • 17. Re: Seam Manager Persistence
            graben

            Hmm, I think the simplest solution for this problem should be that the persistence context should not be instantiated in the for loop. One single context with one transaction should be fine.


            Should I fill a JIRA issue?


            public static PassivatedEntity passivateEntity(Object value)
               {
                  Class entityClass = Seam.getEntityClass( value.getClass() );
                  if (entityClass!=null)
                  {
                     Object persistenceContext = Component.getInstance(persistenceContextName);
                     for ( String persistenceContextName: PersistenceContexts.instance().getTouchedContexts() )
                     {
                        // Object persistenceContext = Component.getInstance(persistenceContextName);
                        return createPassivatedEntity(value, entityClass, persistenceContextName, persistenceContext);
                     }
                  }
                  return null;
               }

            • 18. Re: Seam Manager Persistence
              graben

              Sorry, my answer was a bit too fast but the solution might be some thing similar. You should reduce calls of new persistence context instances!

              • 19. Re: Seam Manager Persistence
                pmuir

                If you go further in the java stack you'll get to ManagedPersistenceContext.getEntityManager(). In my case this method wants to join a transaction.

                Can you establish why it needs to join a transaction? i.e. why the transaction synchronization isn't registered?

                • 20. Re: Seam Manager Persistence
                  graben

                  No. But do you know in which circumstances a transaction can be not synchronizsation registered? That might help to find the reason.

                  • 21. Re: Seam Manager Persistence
                    graben

                    I recognized that every time seam gets a new transaction the check whether the transaction is active fails. That's why it won't get registered and he tries to get a new transaction every time. But the reason therfor must be somewhere in JBoss AS I think!

                    1 2 Previous Next