Hello all,

I'm trying to speed up my DAO tests by using the H2 persistence manager. Till 
now, I have used Derby Persistence Manager, and everything have worked fine. 
When I try to run my tests with H2, I get the stacktrace shown below. My 
configuration for the workspace persistence manager is the following (pretty 
much copied from javadocs for H2PersistenceManager):

<PersistenceManager 
class="org.apache.jackrabbit.core.persistence.bundle.H2PersistenceManager">
            <param name="bundleCacheSize" value="8"/>
            <param name="consistencyCheck" value="false"/>
            <param name="minBlobSize" value="16384"/>
            <param name="driver" value="org.hsqldb.jdbcDriver"/>
            <param name="url" 
value="jdbc:hsqldb:file:${wsp.home}/db/itemState"/>
            <param name="user" value="sa"/>
            <param name="password" value=""/>
            <param name="schema" value="native"/>
            <param name="schemaObjectPrefix" value=""/>
            <param name="errorHandling" value=""/>
        </PersistenceManager>

The configuration for the versioning persistence manager is almost identical, 
only with a different url value ("jdbc:hsqldb:file:version/db/itemState"). Does 
anyone know what the cause of the stacktrace is?

Btw, why is it called H2PersistenceManager when it is using the HSQLDB database?

Thank you for reading this.

Best regards,
Karianne Berg


Stacktrace from log:
ERROR [main] (RepositoryImpl.java:339) - failed to start Repository: Cannot 
instantiate persistence manager 
org.apache.jackrabbit.core.persistence.bundle.H2PersistenceManager: Unexpected 
token: LOCK_TIMEOUT in statement [SET LOCK_TIMEOUT]
javax.jcr.RepositoryException: Cannot instantiate persistence manager 
org.apache.jackrabbit.core.persistence.bundle.H2PersistenceManager: Unexpected 
token: LOCK_TIMEOUT in statement [SET LOCK_TIMEOUT]: Unexpected token: 
LOCK_TIMEOUT in statement [SET LOCK_TIMEOUT]
        at 
org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1163)
        at 
org.apache.jackrabbit.core.RepositoryImpl.createVersionManager(RepositoryImpl.java:383)
        at 
org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:293)
        at 
org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:550)
        at 
org.apache.jackrabbit.core.TransientRepository$1.getRepository(TransientRepository.java:186)
        at 
org.apache.jackrabbit.core.TransientRepository.startRepository(TransientRepository.java:265)
        at 
org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:333)
        at 
org.springmodules.jcr.JcrSessionFactory.getSession(JcrSessionFactory.java:268)
        at 
org.springmodules.jcr.jackrabbit.LocalTransactionManager.doBegin(LocalTransactionManager.java:116)
        at 
org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:350)
        at 
org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:262)
        at 
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:102)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
        at 
org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:630)
        at 
no.uib.ii.dpg2.core.persistence.jcr.JcrPatternDao$$EnhancerByCGLIB$$57f9abe5.importPattern(<generated>)
        at 
no.uib.ii.dpg2.core.persistence.jcr.JcrPatternDaoTest.testGetExistingPatternById(JcrPatternDaoTest.java:29)
        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:597)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.textui.TestRunner.doRun(TestRunner.java:116)
        at 
com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:65)
        at junit.textui.TestRunner.doRun(TestRunner.java:109)
        at 
com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:24)
        at 
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:118)
        at 
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
        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:597)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: java.sql.SQLException: Unexpected token: LOCK_TIMEOUT in statement 
[SET LOCK_TIMEOUT]
        at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
        at org.hsqldb.jdbc.jdbcStatement.fetchResult(Unknown Source)
        at org.hsqldb.jdbc.jdbcStatement.execute(Unknown Source)
        at 
org.apache.jackrabbit.core.persistence.bundle.H2PersistenceManager.checkSchema(H2PersistenceManager.java:107)
        at 
org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager.init(BundleDbPersistenceManager.java:565)
        at 
org.apache.jackrabbit.core.persistence.bundle.H2PersistenceManager.init(H2PersistenceManager.java:98)
        at 
org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1159)
        ... 36 more
java.sql.SQLException: Unexpected token: LOCK_TIMEOUT in statement [SET 
LOCK_TIMEOUT]
        at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
        at org.hsqldb.jdbc.jdbcStatement.fetchResult(Unknown Source)
        at org.hsqldb.jdbc.jdbcStatement.execute(Unknown Source)
        at 
org.apache.jackrabbit.core.persistence.bundle.H2PersistenceManager.checkSchema(H2PersistenceManager.java:107)
        at 
org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager.init(BundleDbPersistenceManager.java:565)
        at 
org.apache.jackrabbit.core.persistence.bundle.H2PersistenceManager.init(H2PersistenceManager.java:98)
        at 
org.apache.jackrabbit.core.RepositoryImpl.createPersistenceManager(RepositoryImpl.java:1159)
        at 
org.apache.jackrabbit.core.RepositoryImpl.createVersionManager(RepositoryImpl.java:383)
        at 
org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:293)
        at 
org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:550)
        at 
org.apache.jackrabbit.core.TransientRepository$1.getRepository(TransientRepository.java:186)
        at 
org.apache.jackrabbit.core.TransientRepository.startRepository(TransientRepository.java:265)
        at 
org.apache.jackrabbit.core.TransientRepository.login(TransientRepository.java:333)
        at 
org.springmodules.jcr.JcrSessionFactory.getSession(JcrSessionFactory.java:268)
        at 
org.springmodules.jcr.jackrabbit.LocalTransactionManager.doBegin(LocalTransactionManager.java:116)
        at 
org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:350)
        at 
org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:262)
        at 
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:102)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
        at 
org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:630)
        at 
no.uib.ii.dpg2.core.persistence.jcr.JcrPatternDao$$EnhancerByCGLIB$$57f9abe5.importPattern(<generated>)
        at 
no.uib.ii.dpg2.core.persistence.jcr.JcrPatternDaoTest.testGetExistingPatternById(JcrPatternDaoTest.java:29)
        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:597)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.textui.TestRunner.doRun(TestRunner.java:116)
        at 
com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:65)
        at junit.textui.TestRunner.doRun(TestRunner.java:109)
        at 
com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:24)
        at 
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:118)
        at 
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
        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:597)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)

Reply via email to