4 Replies Latest reply on Jun 5, 2008 5:35 AM by tom.baeyens

    hibernate mapping problem

    csouillard

      Hi Tom,

      sometimes I am getting an error on variableScopes collection. It is not a "permanent" problem as my test is sometimes successful, sometimes failing.

      This is the error I get :

      org.ow2.bonita.facade.exception.BonitaInternalException: Unexpected Exception arrived in Bonita: null index column for collection: org.jbpm.pvm.impl.ExecutionImpl.variableScopes
      at org.ow2.bonita.facade.exception.BonitaInternalException.build(BonitaInternalException.java:35)
      at org.ow2.bonita.facade.APIInterceptor.manageExceptions(APIInterceptor.java:109)
      at org.ow2.bonita.facade.APIInterceptor.invoke(APIInterceptor.java:117)
      at $Proxy3.setProcessInstanceVariable(Unknown Source)
      at org.ow2.bonita.example.carpool.Carpool.afterInstantiate(Carpool.java:89)
      at org.ow2.bonita.example.AbstractExample.launch(AbstractExample.java:77)
      at org.ow2.bonita.example.carpool.AbstractCarpoolTest.instantiate(AbstractCarpoolTest.java:107)
      at org.ow2.bonita.example.carpool.AbstractCarpoolTest.testCarpoolCancelRequest(AbstractCarpoolTest.java:41)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at junit.framework.TestCase.runTest(TestCase.java:164)
      at junit.framework.TestCase.runBare(TestCase.java:130)
      at junit.framework.TestResult$1.protect(TestResult.java:110)
      at junit.framework.TestResult.runProtected(TestResult.java:128)
      at junit.framework.TestResult.run(TestResult.java:113)
      at junit.framework.TestCase.run(TestCase.java:120)
      at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      Caused by: org.hibernate.HibernateException: null index column for collection: org.jbpm.pvm.impl.ExecutionImpl.variableScopes
      at org.hibernate.persister.collection.AbstractCollectionPersister.readIndex(AbstractCollectionPersister.java:710)
      at org.hibernate.collection.PersistentList.readFrom(PersistentList.java:379)
      at org.hibernate.loader.Loader.readCollectionElement(Loader.java:1008)
      at org.hibernate.loader.Loader.readCollectionElements(Loader.java:646)
      at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:591)
      at org.hibernate.loader.Loader.doQuery(Loader.java:701)
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
      at org.hibernate.loader.Loader.loadCollection(Loader.java:1994)
      at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
      at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:565)
      at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
      at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1716)
      at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344)
      at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
      at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:109)
      at org.hibernate.collection.PersistentList.size(PersistentList.java:91)
      at org.jbpm.pvm.impl.ExecutionScopeIterator.findNextExecutionScopeIndex(ExecutionScopeIterator.java:104)
      at org.jbpm.pvm.impl.ExecutionScopeIterator.findNext(ExecutionScopeIterator.java:73)
      at org.jbpm.pvm.impl.ExecutionScopeIterator.hasNext(ExecutionScopeIterator.java:48)
      at org.ow2.bonita.facade.impl.RuntimeAPIImpl.getGlobalVariableScope(RuntimeAPIImpl.java:262)
      at org.ow2.bonita.facade.impl.RuntimeAPIImpl.setProcessInstanceVariable(RuntimeAPIImpl.java:276)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.ow2.bonita.facade.APIInterceptor.createEnvAndInvoke(APIInterceptor.java:64)
      at org.ow2.bonita.facade.APIInterceptor.retry(APIInterceptor.java:88)
      at org.ow2.bonita.facade.APIInterceptor.manageExceptions(APIInterceptor.java:99)
      ... 22 more



      I found that on the net dealing with this problem :
      http://forum.hibernate.org/viewtopic.php?t=330

      What do you think ?

      Charles

        • 1. Re: hibernate mapping problem
          csouillard

          I have seen that in the pvm, you set explicitely inverse = false for this collection. Is there any reason ?

          For your information, getBlobalVariableScope method is doing the following :

          private VariableScope getGlobalVariableScope(XpdlExecution xpdlExecution) {
          Iterator it = xpdlExecution.getVariableScopeIterator();
          VariableScope vs = null;
          while (it.hasNext()) {
          vs = it.next();
          }
          return vs;
          }

          Charles

          • 2. Re: hibernate mapping problem
            tom.baeyens

            i have seen that error message before. but i don't remember how/if i solved it then.

            variable scope iterator has been removed in the meatime with the introduction of activity instances.

            i never really fully understood inverse is false. i believe that inverse=false means that hibernate has to take the back pointer to determine which objects are in the collection. but this is a bit counter intuitive with the cascading. also, if bidirectional references are implemented correctly, both ends should specify the exact same relation.

            any better insight comments in that matter are appreciated

            • 3. Re: hibernate mapping problem
              csouillard

              Tom,

              I found that topic on the net :
              http://forum.hibernate.org/viewtopic.php?t=948004

              Can you help me on that point please ?
              It is a bit hard for me as Guillaume is dealing with persistence issues but he is not at office for next 10 days..


              Thanks a lot
              Charles

              • 4. Re: hibernate mapping problem
                tom.baeyens

                is there a test in pvm that shows this problem ?