8 Replies Latest reply on Mar 9, 2008 2:35 PM by cpopetz

    EntityManager is closed in cluster

    jbossindia

      I have setup a cluster with two nodes and deployed the application. application contains a SMPC with default scope of conversation.


      I am able to login correctly, which interacts with the DB and load the menus but when I click on other page then it gives me EntityManager is closed. I went through the fourms but not able to solve this.


      Please suggest.

        • 1. Re: EntityManager is closed in cluster
          jbossindia

          After probing further, I found that at the time of validate() method of the EntityQuery is called the persistentContext is having the session  as opened but when another method is called then session is closed.


          I think that it seems to be a problem in cluster.


          could anybody suggest?

          • 2. Re: EntityManager is closed in cluster
            keithnaas

            What leads you to believe it is an issue with the cluster?  Are you receiving other kinds of errors?  Does the same issue occur when you shut down one of the nodes and run through the same steps?

            • 3. Re: EntityManager is closed in cluster
              jbossindia

              I tried running the node 1 in default configuration and it runs fine without any exception.


              But when it runs in cluster and only in one node active then it gives problem


              My sem-gen generated bean extends the EntityQuery with conversation scope
              PersistenceContext is conversation scope.


              Once I invoke the url then it calls the validate method at the time of @Create and then when my method is getting called through my

              <rich:dataTable rendered=#{bean.getList}>


              then it is giving EntityManager is closed

              • 4. Re: EntityManager is closed in cluster
                keithnaas

                Are all of your Conversation and Session scoped beans Serializable? 

                • 5. Re: EntityManager is closed in cluster
                  jbossindia

                  keith,


                  I mentioned earlier that my bean is extending EntityQuery which is serlializable and is in conversation scope.


                  I found that there was similar topic in seam forum Titled EntityHome breaks in cluster. It was mentioned that in case of cluster the entityManager instance is not nulled but closed and subequent requests throws IllegalStateException.


                  But there was no solution posted. I guess that it might be a bug in seams that after the request in conversation get completed then EntityManager is closed.


                  Can you talk to others about the same?

                  • 6. Re: EntityManager is closed in cluster
                    jbossindia

                    I have checked it again and its only in cluster environment EntityManager is getting closed and it seems to be somewhat related to passivation but don't know how to resolve this

                    • 7. Re: EntityManager is closed in cluster
                      jbossindia

                      new piece of information


                      I converted my bean to SFSB (Conversation scope) and stopped extending EntityQuery.


                      Now it does not give the IllegalStateException EntityManager is closed


                      does it mean that I will have to convert all my beans to SFSB and loose the functions of EntityQuery/EntityHome

                      • 8. Re: EntityManager is closed in cluster
                        cpopetz

                        This could be the same thing I reported a while ago: JBSEAM-2666