So something isn't closing the database properly eh? I was able to
reproduce this problem on my end, so you should probably enter an
issue for it. As a workaround, I found that commenting out the second
<execution> block in the dbunit plugin's configuration solves the
problem.
Matt
On 5/22/07, Steve Tynor <
stynor@gmail.com> wrote:
> Matt,
>
> Confirmed fixed. Now I can give you a cookbook to reproduce the
> h2/hsqldb lock errors:
>
> # mvn archetype:create -DarchetypeGroupId=org.appfuse
> -DarchetypeArtifactId=appfuse-basic-jsf
> -DremoteRepositories=
http://static.appfuse.org/repository
> -DarchetypeVersion=2.0-m5-SNAPSHOT -DgroupId=com.mycompany.app
> -DartifactId=myproject
>
> # mvn appfuse:full-source
>
> then edit pom.xml to replace the test database mysql config at the
> bottom of the pom.xml with:
>
>
> <dbunit.dataTypeFactoryName>org.dbunit.ext.hsqldb.HsqldbDataTypeFactory</dbunit.dataTypeFactoryName>
> <dbunit.operation.type>CLEAN_INSERT</dbunit.operation.type>
> <hibernate.dialect>org.hibernate.dialect.HSQLDialect</hibernate.dialect>
> <jdbc.groupId>hsqldb</jdbc.groupId>
> <jdbc.artifactId>hsqldb</jdbc.artifactId>
> <jdbc.version>1.8.0.7</jdbc.version>
> <jdbc.driverClassName>org.hsqldb.jdbcDriver</jdbc.driverClassName>
> <jdbc.url><![CDATA[jdbc:hsqldb:myproject;shutdown=true]]></jdbc.url>
> <jdbc.username>sa</jdbc.username>
> <jdbc.password></jdbc.password>
>
> # mvn clean integration-test
>
> et voila:
>
> [INFO] [dbunit:operation {execution: test}]
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Error executing database operation: CLEAN_INSERT
>
> Embedded error: The database is already in use by another process:
>
org.hsqldb.persist.NIOLockFile@a4df0f73[file=C:\newdev\appfuse-clean\test-for-h2\myproject\myproject.lck,
> exists=true, locked=false, valid=false, fl =null]: java.lang.Exception:
> java.io.IOException: The process cannot access the file because
> another process has locked a portion of the file :
> C:\newdev\appfuse-clean\test-for-h2\myproject\myproject.lck
>
>
> Steve
<jdbc.url><![CDATA[jdbc:hsqldb:/temp/myproject/myprojectdb;shutdown=true]]></jdbc.url>
I'm using a Struts 2 Modular Archetype on my current project (with H2) and this works fine. Here's