1 2 Previous Next 24 Replies Latest reply on Jun 11, 2012 8:53 AM by hsmt Go to original post
      • 15. Re: Invalidation not working with LazyDeserialization on non-basic PK (clustered)
        smarlow

        Is this on JBoss AS?  If yes, which version?  Which versions of Hibernate and Infinispan are you using?

         

        Scott

        • 16. Re: Invalidation not working with LazyDeserialization on non-basic PK (clustered)
          hsmt

          We have our own custom app server.

           

          I initially saw the problem on Hibernate 3.6. Currently I used Hiberate 4.1.1 and now 4.1.3. The original Infinispan version I found it on  was 4.2.1, but it's the same with 5.1.4. But the test I submitted should be able to run on the hibernate git branch, so it doesn't seem to be because of our appserver or any external configuration issues.

          • 17. Re: Invalidation not working with LazyDeserialization on non-basic PK (clustered)
            smarlow

            Here is some of the JBoss AS 7 Hibernate integration code that gives you an idea of what we are doing.  We are passing in the Hibernate

            org.hibernate.cfg.AvailableSettings.SESSION_FACTORY_NAME (setting the new SESSION_FACTORY_NAME_IS_JNDI to false) and also setting the org.hibernate.ejb.AvailableSettings.ENTITY_MANAGER_FACTORY_NAME.  Are you setting these properties also?  If your not using JPA, only the session factory name needs to be configured.

             

            In a clustered environment, the Hibernate session factory uuid is different on every node.  So, its more important to use the session factory name instead (so that at session deserialization time, the right session factory can be looked up). 

             

            It sounds like your hitting other issues but I wanted to ask about this first.

             

            Scott

            • 18. Re: Invalidation not working with LazyDeserialization on non-basic PK (clustered)
              hsmt

              Yes, we are setting those properties.

              • 19. Re: Invalidation not working with LazyDeserialization on non-basic PK (clustered)
                smarlow

                Do you have TRACE logging output for org.hibernate while the test is run?  I'd like to see that.

                 

                Class org.hibernate.internal.SessionFactoryImpl should print messages like the following when we deserialize the session factory (no the node receiving the invalidation message from the other node):

                 

                "Resolving serialized SessionFactory"

                "Resolved SessionFactory by UUID [%s]"

                "Resolved SessionFactory by name [%s]"

                 

                Scott

                • 20. Re: Invalidation not working with LazyDeserialization on non-basic PK (clustered)
                  hsmt

                  Unfortunately, I am not seeing that that. Here is what I am seeing though in the hibernate-infinispan git branch:


                  Line 191: 10:02:44,181 DEBUG [Outgoing Connection [aad9fca3-07bc-4160-8649-bf4216111ea6 port:49373, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]]:0 worker] SessionFactoryRegistry:75 - Registering SessionFactory: 9322d302-cbd3-4461-8b21-6857690fc228 (<unnamed>)

                  Line 192: 10:02:44,181 DEBUG [Outgoing Connection [aad9fca3-07bc-4160-8649-bf4216111ea6 port:49373, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]]:0 worker] SessionFactoryRegistry:82 - Not binding SessionFactory to JNDI, no JNDI name configured

                  Line 192: 10:02:44,181 DEBUG [Outgoing Connection [aad9fca3-07bc-4160-8649-bf4216111ea6 port:49373, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]]:0 worker] SessionFactoryRegistry:82 - Not binding SessionFactory to JNDI, no JNDI name configured

                   

                  And the remote process:


                  Line 949: 10:02:46,544 DEBUG [Outgoing Connection [aad9fca3-07bc-4160-8649-bf4216111ea6 port:49373, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]]:0 worker] SessionFactoryRegistry:75 - Registering SessionFactory: b52e39b5-8084-4e43-93ee-54c530306220 (<unnamed>)

                  Line 949: 10:02:46,544 DEBUG [Outgoing Connection [aad9fca3-07bc-4160-8649-bf4216111ea6 port:49373, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]]:0 worker] SessionFactoryRegistry:75 - Registering SessionFactory: b52e39b5-8084-4e43-93ee-54c530306220 (<unnamed>)

                   

                  In the company code:

                  listener

                  Registering SessionFactory: 3c399e62-7d88-4f3a-acbd-560d5ac92799 (moca/hibernate_session_factory)

                  Not binding SessionFactory to JNDI, no JNDI name configured

                  evictor

                  Registering SessionFactory: 2e2b0960-bcc8-4eec-b82a-8216e241b1f3 (moca/hibernate_session_factory)

                  Not binding SessionFactory to JNDI, no JNDI name configured

                  • 21. Re: Invalidation not working with LazyDeserialization on non-basic PK (clustered)
                    smarlow

                    Saugat Manandhar wrote:

                     

                    SessionFactoryRegistry:75 - Registering SessionFactory: 9322d302-cbd3-4461-8b21-6857690fc228 (<unnamed>)

                     

                    It sounds like the session factory name is not using what you specified for the

                    org.hibernate.cfg.AvailableSettings.SESSION_FACTORY_NAME.  Can you show us your Hibernate configuration settings.

                    • 22. Re: Invalidation not working with LazyDeserialization on non-basic PK (clustered)
                      hsmt

                      Uhm, it's the default one from hibernate-infinispan. So I guess this one?

                       

                       

                      {code}################################################################################

                      # Hibernate, Relational Persistence for Idiomatic Java                         #

                      #                                                                              #

                      # Copyright (c) 2007, Red Hat, Inc. and/or it's affiliates or third-party contributors as    #

                      # indicated by the @author tags or express copyright attribution               #

                      # statements applied by the authors.  All third-party contributions are        #

                      # distributed under license by Red Hat, Inc. and/or it's affiliates.                         #

                      #                                                                              #

                      # This copyrighted material is made available to anyone wishing to use, modify,#

                      # copy, or redistribute it subject to the terms and conditions of the GNU      #

                      # Lesser General Public License, as published by the Free Software Foundation. #

                      #                                                                              #

                      # This program is distributed in the hope that it will be useful,              #

                      # but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY

                      # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License

                      # for more details.                                                            #

                      #                                                                              #

                      # You should have received a copy of the GNU Lesser General Public License     #

                      # along with this distribution; if not, write to:                              #

                      # Free Software Foundation, Inc.                                               #

                      # 51 Franklin Street, Fifth Floor                                              #

                      # Boston, MA  02110-1301  USA                                                  #

                      ################################################################################

                      hibernate.dialect org.hibernate.dialect.H2Dialect

                      hibernate.connection.driver_class org.h2.Driver

                      hibernate.connection.url jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE

                      hibernate.connection.username sa

                      # hibernate.connection.password

                       

                      hibernate.connection.pool_size 5

                       

                       

                      hibernate.format_sql true

                       

                       

                      hibernate.max_fetch_depth 5

                       

                       

                      hibernate.generate_statistics true

                       

                       

                      # NOTE: hibernate.jdbc.batch_versioned_data should be set to false when testing with Oracle

                      hibernate.jdbc.batch_versioned_data true{code}

                       

                       

                       

                      I added this just in case, but still nothing.

                       

                      hibernate.session_factory_name test/hibernate_session_factory

                      hibernate.session_factory_name_is_jndi false

                       

                      It does change the output to this though:

                      Registering SessionFactory: 7d39b113-d65b-4863-9e31-8995c50f4cd7 (test/hibernate_session_factory)

                      • 23. Re: Invalidation not working with LazyDeserialization on non-basic PK (clustered)
                        smarlow

                        It sounds like you have found the right file to change which should prevent other problems from occurring. 

                         

                        From startup until the failure, could you show us the rest of the TRACE log output (including any output from the failure).  I'm not looking for anything specific but we might see additional clues.  If there is some output that contains top secret/private information, you could delete that if you like.

                         

                        Scott

                        • 24. Re: Invalidation not working with LazyDeserialization on non-basic PK (clustered)
                          hsmt

                          Here is the trace with org.hibernate and org.infinispan turned on. It's just the infinispan/hibernate thing though.

                          1 2 Previous Next