Hi,
I'm trying to test the creation of an object from my datamodel(Organisation) and the creation process includes the creation of an acl for the newly created organisation all in the same transaction.
The process is as followed:
1. The organisation gets created
2. The acl is being searched to check if it already exists
3. if it exists it will be updated, otherwise it will be created
Everything works fine when running with one thread, however, when adding a second thread some the of the creations fail with the following exception:
[ObjectDB 2.2.8_07] javax.persistence.PersistenceException Failed to read from file 'C:\Dev\contextspace\cs_services\trunk\objectdb\db\contextspace.odb' (error 117) at com.objectdb.jpa.JpaQuery.getResultList(JpaQuery.java:633) at com.contextspace.acl.JpaBasicLookupStrategy.lookupObjectIdentities(JpaBasicLookupStrategy.java:166) at com.contextspace.acl.JpaBasicLookupStrategy.readAclsById(JpaBasicLookupStrategy.java:110) at com.contextspace.acl.JpaAclService.readAclsById(JpaAclService.java:109) at com.contextspace.acl.JpaAclService.readAclById(JpaAclService.java:88) at com.contextspace.acl.JpaAclService.readAclById(JpaAclService.java:79) at com.contextspace.acl.JpaMutableAclService.createAcl(JpaMutableAclService.java:115) at com.contextspace.services.impl.SecurityHelper.addPermission(SecurityHelper.java:149) at com.contextspace.services.impl.SecurityHelper.addPermission(SecurityHelper.java:120) at com.contextspace.services.impl.OrganisationService.add(OrganisationService.java:71) at com.contextspace.services.impl.OrganisationService.add(OrganisationService.java:1) at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:67) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy27.add(Unknown Source) at com.contextspace.services.OrganisationMultiThreadedPerfTest$BasicThread.run(OrganisationMultiThreadedPerfTest.java:103) Caused by: com.objectdb.o.UserException: Failed to read from file 'C:\Dev\contextspace\cs_services\trunk\objectdb\db\contextspace.odb' at com.objectdb.o.MSG.d(MSG.java:74) at com.objectdb.o.LFL.T(LFL.java:1059) at com.objectdb.o.PAG.al(PAG.java:806) at com.objectdb.o.PGC.w(PGC.java:235) at com.objectdb.o.SNP.B(SNP.java:342) at com.objectdb.o.OBI.v(OBI.java:430) at com.objectdb.o.OBI.s(OBI.java:339) at com.objectdb.o.OBI.r(OBI.java:266) at com.objectdb.o.OBI.U6(OBI.java:232) at com.objectdb.o.BQI.Vf(BQI.java:140) at com.objectdb.o.PRG.ad(PRG.java:698) at com.objectdb.o.PRG.ab(PRG.java:627) at com.objectdb.o.QRM.US(QRM.java:259) at com.objectdb.o.MST.US(MST.java:884) at com.objectdb.o.WRA.US(WRA.java:286) at com.objectdb.o.WSM.US(WSM.java:113) at com.objectdb.o.QRR.g(QRR.java:225) at com.objectdb.o.QRR.b(QRR.java:144) at com.objectdb.jpa.JpaQuery.getResultList(JpaQuery.java:627) ... 23 more Caused by: java.io.EOFException at java.io.RandomAccessFile.readFully(RandomAccessFile.java:383) at com.objectdb.o.LFL.T(LFL.java:1056) ... 40 more
The exception is being thrown during step 2.
Any ideas regarding what may be the cause for this exception? I could understand a concurrency issue when persisting but during a lookup doesn't make a lot of sense.
Thanks,
Eitan