Re: [m2] can't get hibernate plugin to work with hsql

2008-04-29 Thread Mick Knutson
I am using the examples from Spring in Action II. So I am not sure how to
determin that.

Here are my dependancies in my core:





javax.activation
activation
1.0.2
compile



javax.mail
mail
1.4
compile



commons-beanutils
commons-beanutils
1.8.0-BETA
compile



commons-collections
commons-collections
3.2
compile



commons-dbcp
commons-dbcp
1.2.2



javax.transaction
jta
1.0.1B



org.dbunit
dbunit
2.2.1
test



log4j
log4j
1.2.13



org.springframework
spring
${spring.version}
compile



org.springframework
spring-aspects
${spring.version}
compile



org.springframework
spring-beans
${spring.version}
compile



org.springframework
spring-context
${spring.version}
compile



org.springframework
spring-core
${spring.version}
compile



org.springframework
spring-jdbc
${spring.version}
provided



org.springframework
spring-orm
${spring.version}
compile



org.springframework
spring-support
2.0.8
provided



org.springframework
spring-test
${spring.version}





org.hibernate
hibernate
${hibernate.version}
compile


org.hibernate
hibernate-entitymanager
${hibernate-entitymanager.version}
compile


org.hibernate
hibernate-annotations
${hibernate-annotations.version}
compile


org.hibernate
hibernate-commons-annotations
${hibernate-annotations.version}
compile



org.hibernate
hibernate-tools
3.2.0.beta9a



c3p0
c3p0
0.9.1.2





On Tue, Apr 29, 2008 at 11:04 AM, Johann Reyes <[EMAIL PROTECTED]>
wrote:

> Hmm, so are you using JPA or EJB? because if it is JPA you need to use
> jpaconfiguration. Just check that you have the dependencies as seen here:
>
>
> http://fisheye.codehaus.org/browse/mojo/trunk/mojo/hibernate3/hibernate3-maven-plugin/src/it/jpa-configuration-hsql/pom.xml?r=6864
>
> Regards
>
> Johann Reyes
>



-- 
Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.linkedin.com/in/mickknutson
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/BLiNCMagazine
http://tahoe.baselogic.com
---


Re: [m2] can't get hibernate plugin to work with hsql

2008-04-29 Thread Johann Reyes
Hmm, so are you using JPA or EJB? because if it is JPA you need to use
jpaconfiguration. Just check that you have the dependencies as seen here:

http://fisheye.codehaus.org/browse/mojo/trunk/mojo/hibernate3/hibernate3-maven-plugin/src/it/jpa-configuration-hsql/pom.xml?r=6864

Regards

Johann Reyes


Re: [m2] can't get hibernate plugin to work with hsql

2008-04-29 Thread Mick Knutson
Oops. Here is what I changed

*


annotationconfiguration*


On Tue, Apr 29, 2008 at 10:52 AM, Mick Knutson <[EMAIL PROTECTED]>
wrote:

> Now when I changed the ... to annotations.
>
> *I get this in my stack:*
> *[myproject] INFO [main] Version.(15) | Hibernate EntityManager
> 3.3.1.GA
> [myproject] DEBUG [main] Ejb3Configuration.configure(302) | Processing
> PersistenceUnitInfo [
> name: ApplicationEntityManager
> persistence provider classname:
> org.hibernate.ejb.HibernatePersistence
> classloader: [EMAIL PROTECTED]
> Temporary classloader:
> [EMAIL PROTECTED]
> excludeUnlistedClasses: false
> JTA datasource: null
> Non JTA datasource: com.mchange.v2.c3p0.ComboPooledDataSource [
> acquireIncrement -> 1, acquireRetryAttempts -> 0, acquireRetryDelay -> 10
> 00, autoCommitOnClose -> false, automaticTestTable -> null,
> breakAfterAcquireFailure -> false, checkoutTimeout -> 0,
> connectionCustomizerClassNam
> e -> null, connectionTesterClassName ->
> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName ->
> 2xu9es7t1731bsy1czqhpw|1700391, debug
> UnreturnedConnectionStackTraces -> false, description -> null, driverClass
> -> org.hsqldb.jdbcDriver, factoryClassLocation -> null, forceIgnoreUnr
> esolvedTransactions -> false, identityToken ->
> 2xu9es7t1731bsy1czqhpw|1700391, idleConnectionTestPeriod -> 0,
> initialPoolSize -> 0, jdbcUrl -> jd
> bc:hsqldb:file:target/testdb-hsql;shutdown=true, maxAdministrativeTaskTime
> -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnec
> tions -> 0, maxPoolSize -> 2, maxStatements -> 0,
> maxStatementsPerConnection -> 0, minPoolSize -> 1, numHelperThreads -> 3,
> numThreadsAwaitingChe
> ckoutDefaultUser -> 0, preferredTestQuery -> null, properties ->
> {user=**, password=**}, propertyCycle -> 0, testConnectionOnCheckin
> -> f
> alse, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0,
> usesTraditionalReflectiveProxies -> false ]
> Transaction type: RESOURCE_LOCAL
> PU root URL:
> file:/C:/opt/temp/appfuse/myproject/core/target/classes/
> Jar files URLs []
> Managed classes names [
> com.baselogic.domain.VersionedObject
> com.baselogic.domain.IdentifiedObject
> com.baselogic.domain.User
> com.baselogic.domain.Role
> com.baselogic.domain.Address]
> Mapping files names []
> Properties [
> hibernate.hbm2ddl.auto: create]
> *
>
> *Then there is this error:*
>
> *[myproject] INFO [main] SchemaExport.importScript(238) | Executing import
> script: /import.sql
> [myproject] DEBUG [main] SchemaExport.importScript(253) | INSERT INTO
> `address` VALUES ('-1', '1', '725 Florida Street #5', 'San Francisco', 'US'
> , '94110', 'CA')
> [myproject] ERROR [main] SchemaExport.execute(202) | schema export
> unsuccessful
> org.hibernate.JDBCException: Error during import script execution
> at
> org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:258)
> at
> org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:192)
> at
> org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
> at
> org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:311)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1300)
> at
> org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
> at
> org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:730)
> at
> org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
> at
> org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactory
> Bean.java:227)
> at
> org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:281)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java
> :1333)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:12
> 99)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:463)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:404)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:375)
> at
> org.springframework.beans.factory.support.

Re: [m2] can't get hibernate plugin to work with hsql

2008-04-29 Thread Johann Reyes
It looks like its missing the entity-manager dependency, do you have it
specified in your pom?

Regards

Johann Reyes


Re: [m2] can't get hibernate plugin to work with hsql

2008-04-29 Thread Mick Knutson
Now when I changed the ... to annotations.

*I get this in my stack:*
*[myproject] INFO [main] Version.(15) | Hibernate EntityManager
3.3.1.GA
[myproject] DEBUG [main] Ejb3Configuration.configure(302) | Processing
PersistenceUnitInfo [
name: ApplicationEntityManager
persistence provider classname:
org.hibernate.ejb.HibernatePersistence
classloader: [EMAIL PROTECTED]
Temporary classloader:
[EMAIL PROTECTED]
excludeUnlistedClasses: false
JTA datasource: null
Non JTA datasource: com.mchange.v2.c3p0.ComboPooledDataSource [
acquireIncrement -> 1, acquireRetryAttempts -> 0, acquireRetryDelay -> 10
00, autoCommitOnClose -> false, automaticTestTable -> null,
breakAfterAcquireFailure -> false, checkoutTimeout -> 0,
connectionCustomizerClassNam
e -> null, connectionTesterClassName ->
com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName ->
2xu9es7t1731bsy1czqhpw|1700391, debug
UnreturnedConnectionStackTraces -> false, description -> null, driverClass
-> org.hsqldb.jdbcDriver, factoryClassLocation -> null, forceIgnoreUnr
esolvedTransactions -> false, identityToken ->
2xu9es7t1731bsy1czqhpw|1700391, idleConnectionTestPeriod -> 0,
initialPoolSize -> 0, jdbcUrl -> jd
bc:hsqldb:file:target/testdb-hsql;shutdown=true, maxAdministrativeTaskTime
-> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnec
tions -> 0, maxPoolSize -> 2, maxStatements -> 0, maxStatementsPerConnection
-> 0, minPoolSize -> 1, numHelperThreads -> 3, numThreadsAwaitingChe
ckoutDefaultUser -> 0, preferredTestQuery -> null, properties ->
{user=**, password=**}, propertyCycle -> 0, testConnectionOnCheckin
-> f
alse, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0,
usesTraditionalReflectiveProxies -> false ]
Transaction type: RESOURCE_LOCAL
PU root URL:
file:/C:/opt/temp/appfuse/myproject/core/target/classes/
Jar files URLs []
Managed classes names [
com.baselogic.domain.VersionedObject
com.baselogic.domain.IdentifiedObject
com.baselogic.domain.User
com.baselogic.domain.Role
com.baselogic.domain.Address]
Mapping files names []
Properties [
hibernate.hbm2ddl.auto: create]
*

*Then there is this error:*

*[myproject] INFO [main] SchemaExport.importScript(238) | Executing import
script: /import.sql
[myproject] DEBUG [main] SchemaExport.importScript(253) | INSERT INTO
`address` VALUES ('-1', '1', '725 Florida Street #5', 'San Francisco', 'US'
, '94110', 'CA')
[myproject] ERROR [main] SchemaExport.execute(202) | schema export
unsuccessful
org.hibernate.JDBCException: Error during import script execution
at
org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:258)
at
org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:192)
at
org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
at
org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:311)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1300)
at
org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
at
org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:730)
at
org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
at
org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactory
Bean.java:227)
at
org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:281)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java
:1333)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:12
99)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:463)

at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:404)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:375)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:263)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:170)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:260)
at
org.springframework.beans.factory.suppor

Re: [m2] can't get hibernate plugin to work with hsql

2008-04-29 Thread Mick Knutson
So at first, with adding your plugin declaration, I get this error:
*[INFO] [hibernate3:hbm2ddl {execution: hbm2ddl}]
[myproject] INFO [main] Version.(15) | Hibernate EntityManager
3.2.0.GA
[myproject] INFO [main] Version.(15) | Hibernate Annotations
3.2.0.GA
[myproject] INFO [main] Environment.(500) | Hibernate 3.2.0.cr5
[myproject] INFO [main] Environment.(533) | hibernate.properties not
found
[myproject] INFO [main] Environment.buildBytecodeProvider(667) | Bytecode
provider name : cglib
[myproject] INFO [main] Environment.(584) | using JDK 1.4
java.sql.Timestamp handling
[myproject] DEBUG [main] Ejb3Configuration.configure(194) | Look up for
persistence unit: ejb3test
[myproject] DEBUG [main] Ejb3Configuration.configure(206) | Analyse of
persistence.xml: file:/C:/opt/temp/appfuse/myproject/core/target/classes/M
ETA-INF/persistence.xml
[myproject] DEBUG [main] DTDEntityResolver.resolveEntity(38) | trying to
resolve system-id [http://java.sun.com/xml/ns/persistence/persistence_1_
0.xsd]
[myproject] DEBUG [main] EJB3DTDEntityResolver.resolveEntity(49) |
recognized EJB3 ORM namespace; attempting to resolve on classpath under
org/hi
bernate/ejb
[myproject] DEBUG [main] EJB3DTDEntityResolver.resolveEntity(58) | located [
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd] in classp
ath
[myproject] DEBUG [main] PersistenceXmlLoader.parsePersistenceUnit(115) |
Persistent Unit name from persistence.xml: ApplicationEntityManager
[myproject] DEBUG [main] Ejb3Configuration.configure(213) |
PersistenceMetadata [
name: ApplicationEntityManager
jtaDataSource: null
nonJtaDataSource: null
transactionType: RESOURCE_LOCAL
provider: org.hibernate.ejb.HibernatePersistence
classes[
com.baselogic.domain.VersionedObject
com.baselogic.domain.IdentifiedObject   com.baselogic.domain.User
com.baselogic.domain.Role   com.baselogic.domain.Address]
packages[
]
mappingFiles[
]
jarFiles[
]
hbmfiles: 0
properties[
hibernate.hbm2ddl.auto: create
]]
[myproject] DEBUG [main] Ejb3Configuration.getDetectedArtifacts(522) |
Detect class: true; detect hbm: true
[myproject] DEBUG [main] JarVisitor.unqualify(192) | Searching mapped
entities in jar/par: file:/C:/opt/temp/appfuse/myproject/core/target/classe
s
[ERROR] Persistence unit not found: 'ejb3test'.
[INFO]

[ERROR] BUILD ERROR
[INFO]

[INFO] Couldn't create Configuration object
[INFO]

[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Couldn't create
Configuration object
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Couldn't create
Configuration object
at
org.codehaus.mojo.hibernate3.configuration.AbstractComponentConfiguration.getConfiguration(AbstractComponentConfiguration.java:38)
at
org.codehaus.mojo.hibernate3.exporter.Hbm2DDLExporterMojo.doExecute(Hbm2DDLExporterMojo.java:87)
at
org.codehaus.mojo.hibernate3.HibernateExporterMojo.execute(HibernateExporterMojo.java:140)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Def

Re: [m2] can't get hibernate plugin to work with hsql

2008-04-29 Thread Johann Reyes
k.  I created a sample project that does what you want to do:

http://fisheye.codehaus.org/browse/mojo/trunk/mojo/hibernate3/hibernate3-maven-plugin/src/it/jpa-configuration-hsql

Let me know if this helps you or not.

Regards


Johann Reyes


Re: [m2] can't get hibernate plugin to work with hsql

2008-04-29 Thread Mick Knutson
JPA.

My DAO signiture is:

public class BaseDaoJpaImpl extends *
JpaDaoSupport*
implements BaseDao {


On Tue, Apr 29, 2008 at 9:36 AM, Johann Reyes <[EMAIL PROTECTED]> wrote:

> Hello Mick.
>
> First, is this a JPA project or a EJB3 one?
>
> Regards
>
> Johann Reyes
>



-- 
Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.linkedin.com/in/mickknutson
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/BLiNCMagazine
http://tahoe.baselogic.com
---


Re: [m2] can't get hibernate plugin to work with hsql

2008-04-29 Thread Johann Reyes
Hello Mick.

First, is this a JPA project or a EJB3 one?

Regards

Johann Reyes


Re: [m2] can't get hibernate plugin to work with hsql

2008-04-28 Thread Mick Knutson
Nothing is pointing to that DB. This is only for DBUnit tests. But I would
expect H2 and MySql to not react differently with DBUnit than hsql does.



On Mon, Apr 28, 2008 at 6:07 PM, Adam Hardy <[EMAIL PROTECTED]>
wrote:

> Why does the JDBC URL has shutdown=true as a parameter? Surely that closes
> the DB and throws an exception? Although that doesn't account for the
> operation trying to find a table, which is further than it ought to get.
>
> It does look very much like you've got a problem with the database
> disappearing between building it and trying to read it. Either it dies
> completely or it's in the wrong schema.
>
> I don't know what's causing the lock. Is it another SQL client that you're
> point at the db? (squirrel?)
>
>
> Mick Knutson on 29/04/08 01:40, wrote:
>
> > When I use the
> > **I
> > get this error:
> >
> > *[INFO] Error executing database operation: CLEAN_INSERT
> >
> > Embedded error: The database is already in use by another process:
> > [EMAIL PROTECTED]
> > =C:\opt\temp\appfuse\myproject\co
> > re\src\test\resources\sql\testdb.lck, exists=true, locked=false,
> > valid=false, fl =null]: java.lang.Exception:  java.io.IOException: The
> > process c
> > annot access the file because another process has locked a portion of
> > the
> > file : C:\opt\temp\appfuse\myproject\core\src\test\resources\sql\testdb
> > .lck
> > *
> >
> > Then I used *
> >
> > *and
> > got this error:
> >
> > *

Re: [m2] can't get hibernate plugin to work with hsql

2008-04-28 Thread Adam Hardy
Why does the JDBC URL has shutdown=true as a parameter? Surely that closes the 
DB and throws an exception? Although that doesn't account for the operation 
trying to find a table, which is further than it ought to get.


It does look very much like you've got a problem with the database disappearing 
between building it and trying to read it. Either it dies completely or it's in 
the wrong schema.


I don't know what's causing the lock. Is it another SQL client that you're point 
at the db? (squirrel?)


Mick Knutson on 29/04/08 01:40, wrote:

When I use the **I
get this error:

*[INFO] Error executing database operation: CLEAN_INSERT

Embedded error: The database is already in use by another process:
[EMAIL PROTECTED]
=C:\opt\temp\appfuse\myproject\co
re\src\test\resources\sql\testdb.lck, exists=true, locked=false,
valid=false, fl =null]: java.lang.Exception:  java.io.IOException: The
process c
annot access the file because another process has locked a portion of the
file : C:\opt\temp\appfuse\myproject\core\src\test\resources\sql\testdb
.lck
*

Then I used *
*and
got this error:

*

Re: [m2] can't get hibernate plugin to work with hsql

2008-04-28 Thread Mick Knutson
When I use the **I
get this error:

*[INFO] Error executing database operation: CLEAN_INSERT

Embedded error: The database is already in use by another process:
[EMAIL PROTECTED]
=C:\opt\temp\appfuse\myproject\co
re\src\test\resources\sql\testdb.lck, exists=true, locked=false,
valid=false, fl =null]: java.lang.Exception:  java.io.IOException: The
process c
annot access the file because another process has locked a portion of the
file : C:\opt\temp\appfuse\myproject\core\src\test\resources\sql\testdb
.lck
*

Then I used *
*and
got this error:

*

Re: [m2] can't get hibernate plugin to work with hsql

2008-04-28 Thread Adam Hardy
Sorry. I keep confusing them. HSQL is also known as Hypersonic. Can be 
confusing. But have you checked out whether the schema creation really occurs 
and then gets lost, or whether it just never happens?


Try the JDBC params such as default_schema=true

or try a file db instead of in-memory e.g.

jdbc:hsqldb:file:src/test/resources/sql/testdb

Mick Knutson on 29/04/08 00:06, wrote:

I do not have any issues with h2 and it is working fairly good. But HSQL
does not work.

Will this parameter work on HSQL as well?


On Mon, Apr 28, 2008 at 3:50 PM, Adam Hardy <[EMAIL PROTECTED]>
wrote:


Hi Mick,

have you tried using the param on the end of the JDBC URL like this:

jdbc:h2:mem:test_db;DB_CLOSE_DELAY=-1

it might be the case that hibernate is using seperate connections to build
the schema and then access it - in which case H2 can just drop everything.



Mick Knutson on 27/04/08 16:39, wrote:


I ran through this entire chapter. There was nothing new to what I was
already doing. As I stated, everything works fine in MySql. The tables
get
created, then the data gets populated, then the  dbunit tests get run
just
fine. No issues.

But when I move to hsql, the sql file from the hibernate plugin gets
generated, but I get several different failures now.

*1. When I use the false, the import.sql that is generated
does
not have table drop statements, thus I get this error:*
*[myproject] ERROR [main] SchemaExport.execute(202) | schema export
unsuccessful
org.hibernate.JDBCException: Error during import script execution
   at

org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:258)
   at
org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:192)
   at
org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
   at

org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:311)
...
Caused by: java.sql.SQLException: Table already exists: USER_ROLE in
statement [create table user_role]
   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

com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:1006)
   at

org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:254)
*


*2. When I use the true my iport.sql that gets generated
starts
like:*
*alter table app_user drop constraint FK459C57294AD68248;
alter table user_role drop constraint FK143BF46AE8EA6EF6;
alter table user_role drop constraint FK143BF46A43BFAB16;
drop table address if exists;
drop table app_user if exists;
drop table role if exists;
drop table user_role if exists;*

*But then I get this error:*
*Caused by: java.sql.SQLException: Table not found: APP_USER in
statement
[alter table app_user]
   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.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
   at

org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
   at

org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:254)*

So it appears the sql that is generated is failing. The app_user table
does
not exist because this is a memory db right?

*Then I tried to just scale everything back to what you had, but adding
execution phase like:*
   *
   org.codehaus.mojo
   hibernate3-maven-plugin
   2.1
   
   
   
   hbm2ddl

annotationconfiguration
   
   
   
   
   
   hbm2ddl
   process-test-resources
   
   hbm2ddl
   
   
   
   
   
   ${jdbc.groupId}
   ${jdbc.artifactId}
   ${jdbc.version}
   
   
   
*
*
and I still get:*

*[myproject] DEBUG [main] RoleDaoJpaTest.prepareDataSet(34) | Invoked
prepareDataSet()
[myproject] INFO [main] RoleDaoJpaTest.toString(168) |
==
[myproject] INFO [main] RoleDaoJpaTest.toString(169) | package
org.dbunit.dataset.class org.dbunit.dataset.ReplacementDataSet
[myproject] INFO [main] RoleDaoJpaTest.toString(170) |
==
[myproject] INFO [main] RoleDaoJpaTest.toString(171) |
[EMAIL PROTECTED]
 _dataSet=[address, role, app_user, user_role]
 _objectMap={}
 _substringMap={}
 _startDelim=
 _endDelim=
]
[myproject] INFO [main] RoleDaoJpaTest.toString(177) |
=

Re: [m2] can't get hibernate plugin to work with hsql

2008-04-28 Thread Mick Knutson
I do not have any issues with h2 and it is working fairly good. But HSQL
does not work.

Will this parameter work on HSQL as well?


On Mon, Apr 28, 2008 at 3:50 PM, Adam Hardy <[EMAIL PROTECTED]>
wrote:

> Hi Mick,
>
> have you tried using the param on the end of the JDBC URL like this:
>
> jdbc:h2:mem:test_db;DB_CLOSE_DELAY=-1
>
> it might be the case that hibernate is using seperate connections to build
> the schema and then access it - in which case H2 can just drop everything.
>
>
>
> Mick Knutson on 27/04/08 16:39, wrote:
>
> > I ran through this entire chapter. There was nothing new to what I was
> > already doing. As I stated, everything works fine in MySql. The tables
> > get
> > created, then the data gets populated, then the  dbunit tests get run
> > just
> > fine. No issues.
> >
> > But when I move to hsql, the sql file from the hibernate plugin gets
> > generated, but I get several different failures now.
> >
> > *1. When I use the false, the import.sql that is generated
> > does
> > not have table drop statements, thus I get this error:*
> > *[myproject] ERROR [main] SchemaExport.execute(202) | schema export
> > unsuccessful
> > org.hibernate.JDBCException: Error during import script execution
> >at
> >
> > org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:258)
> >at
> > org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:192)
> >at
> > org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
> >at
> >
> > org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:311)
> > ...
> > Caused by: java.sql.SQLException: Table already exists: USER_ROLE in
> > statement [create table user_role]
> >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
> >
> > com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:1006)
> >at
> >
> > org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:254)
> > *
> >
> >
> > *2. When I use the true my iport.sql that gets generated
> > starts
> > like:*
> > *alter table app_user drop constraint FK459C57294AD68248;
> > alter table user_role drop constraint FK143BF46AE8EA6EF6;
> > alter table user_role drop constraint FK143BF46A43BFAB16;
> > drop table address if exists;
> > drop table app_user if exists;
> > drop table role if exists;
> > drop table user_role if exists;*
> >
> > *But then I get this error:*
> > *Caused by: java.sql.SQLException: Table not found: APP_USER in
> > statement
> > [alter table app_user]
> >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.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
> >at
> >
> > org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
> >at
> >
> > org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:254)*
> >
> > So it appears the sql that is generated is failing. The app_user table
> > does
> > not exist because this is a memory db right?
> >
> > *Then I tried to just scale everything back to what you had, but adding
> > execution phase like:*
> >*
> >org.codehaus.mojo
> >hibernate3-maven-plugin
> >2.1
> >
> >
> >
> >hbm2ddl
> >
> > annotationconfiguration
> >
> >
> >
> >
> >
> >hbm2ddl
> >process-test-resources
> >
> >hbm2ddl
> >
> >
> >
> >
> >
> >${jdbc.groupId}
> >${jdbc.artifactId}
> >${jdbc.version}
> >
> >
> >
> > *
> > *
> > and I still get:*
> >
> > *[myproject] DEBUG [main] RoleDaoJpaTest.prepareDataSet(34) | Invoked
> > prepareDataSet()
> > [myproject] INFO [main] RoleDaoJpaTest.toString(168) |
> > ==
> > [myproject] INFO [main] RoleDaoJpaTest.toString(169) | package
> > org.dbunit.dataset.class org.dbunit.dataset.ReplacementDataSet
> > [myproject] INFO [main] RoleDaoJpaTest.toString(170) |
> > ==
> > [myproject] INFO [main] RoleDaoJpaTest.toString(171) |
> > [EMAIL PROTECTED]
> >  _dataSet=[address, role, app_user, user_role]
> >  _objectMap={}
> >  _substringMap={}
> >  _startDelim=
> >  _endDelim=
> > ]

Re: [m2] can't get hibernate plugin to work with hsql

2008-04-28 Thread Adam Hardy

Hi Mick,

have you tried using the param on the end of the JDBC URL like this:

jdbc:h2:mem:test_db;DB_CLOSE_DELAY=-1

it might be the case that hibernate is using seperate connections to build the 
schema and then access it - in which case H2 can just drop everything.



Mick Knutson on 27/04/08 16:39, wrote:

I ran through this entire chapter. There was nothing new to what I was
already doing. As I stated, everything works fine in MySql. The tables get
created, then the data gets populated, then the  dbunit tests get run just
fine. No issues.

But when I move to hsql, the sql file from the hibernate plugin gets
generated, but I get several different failures now.

*1. When I use the false, the import.sql that is generated does
not have table drop statements, thus I get this error:*
*[myproject] ERROR [main] SchemaExport.execute(202) | schema export
unsuccessful
org.hibernate.JDBCException: Error during import script execution
at
org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:258)
at
org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:192)
at
org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
at
org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:311)
...
Caused by: java.sql.SQLException: Table already exists: USER_ROLE in
statement [create table user_role]
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
com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:1006)
at
org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:254)
*


*2. When I use the true my iport.sql that gets generated starts
like:*
*alter table app_user drop constraint FK459C57294AD68248;
alter table user_role drop constraint FK143BF46AE8EA6EF6;
alter table user_role drop constraint FK143BF46A43BFAB16;
drop table address if exists;
drop table app_user if exists;
drop table role if exists;
drop table user_role if exists;*

*But then I get this error:*
*Caused by: java.sql.SQLException: Table not found: APP_USER in statement
[alter table app_user]
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.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
at
org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
at
org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:254)*

So it appears the sql that is generated is failing. The app_user table does
not exist because this is a memory db right?

*Then I tried to just scale everything back to what you had, but adding
execution phase like:*
*
org.codehaus.mojo
hibernate3-maven-plugin
2.1



hbm2ddl

annotationconfiguration





hbm2ddl
process-test-resources

hbm2ddl





${jdbc.groupId}
${jdbc.artifactId}
${jdbc.version}



*
*
and I still get:*

*[myproject] DEBUG [main] RoleDaoJpaTest.prepareDataSet(34) | Invoked
prepareDataSet()
[myproject] INFO [main] RoleDaoJpaTest.toString(168) |
==
[myproject] INFO [main] RoleDaoJpaTest.toString(169) | package
org.dbunit.dataset.class org.dbunit.dataset.ReplacementDataSet
[myproject] INFO [main] RoleDaoJpaTest.toString(170) |
==
[myproject] INFO [main] RoleDaoJpaTest.toString(171) |
[EMAIL PROTECTED]
  _dataSet=[address, role, app_user, user_role]
  _objectMap={}
  _substringMap={}
  _startDelim=
  _endDelim=
]
[myproject] INFO [main] RoleDaoJpaTest.toString(177) |
==
[myproject] DEBUG [main] RoleDaoJpaTest.loadSeedData(73) | Exception in
initializing database
org.dbunit.dataset.NoSuchTableException: address
org.dbunit.dataset.NoSuchTableException: address
at
org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:223)
at
org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:223)
*


Then looking around, it seems to be failing like:

*[myproject] INFO [main] SchemaExport.execute(154) | Running hbm2ddl schema
export
[myproject] DEBUG [main] SchemaExport.ex

Re: [m2] can't get hibernate plugin to work with hsql

2008-04-27 Thread Mick Knutson
I ran through this entire chapter. There was nothing new to what I was
already doing. As I stated, everything works fine in MySql. The tables get
created, then the data gets populated, then the  dbunit tests get run just
fine. No issues.

But when I move to hsql, the sql file from the hibernate plugin gets
generated, but I get several different failures now.

*1. When I use the false, the import.sql that is generated does
not have table drop statements, thus I get this error:*
*[myproject] ERROR [main] SchemaExport.execute(202) | schema export
unsuccessful
org.hibernate.JDBCException: Error during import script execution
at
org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:258)
at
org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:192)
at
org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
at
org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:311)
...
Caused by: java.sql.SQLException: Table already exists: USER_ROLE in
statement [create table user_role]
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
com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:1006)
at
org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:254)
*


*2. When I use the true my iport.sql that gets generated starts
like:*
*alter table app_user drop constraint FK459C57294AD68248;
alter table user_role drop constraint FK143BF46AE8EA6EF6;
alter table user_role drop constraint FK143BF46A43BFAB16;
drop table address if exists;
drop table app_user if exists;
drop table role if exists;
drop table user_role if exists;*

*But then I get this error:*
*Caused by: java.sql.SQLException: Table not found: APP_USER in statement
[alter table app_user]
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.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
at
org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264)
at
org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:254)*

So it appears the sql that is generated is failing. The app_user table does
not exist because this is a memory db right?

*Then I tried to just scale everything back to what you had, but adding
execution phase like:*
*
org.codehaus.mojo
hibernate3-maven-plugin
2.1



hbm2ddl

annotationconfiguration





hbm2ddl
process-test-resources

hbm2ddl





${jdbc.groupId}
${jdbc.artifactId}
${jdbc.version}



*
*
and I still get:*

*[myproject] DEBUG [main] RoleDaoJpaTest.prepareDataSet(34) | Invoked
prepareDataSet()
[myproject] INFO [main] RoleDaoJpaTest.toString(168) |
==
[myproject] INFO [main] RoleDaoJpaTest.toString(169) | package
org.dbunit.dataset.class org.dbunit.dataset.ReplacementDataSet
[myproject] INFO [main] RoleDaoJpaTest.toString(170) |
==
[myproject] INFO [main] RoleDaoJpaTest.toString(171) |
[EMAIL PROTECTED]
  _dataSet=[address, role, app_user, user_role]
  _objectMap={}
  _substringMap={}
  _startDelim=
  _endDelim=
]
[myproject] INFO [main] RoleDaoJpaTest.toString(177) |
==
[myproject] DEBUG [main] RoleDaoJpaTest.loadSeedData(73) | Exception in
initializing database
org.dbunit.dataset.NoSuchTableException: address
org.dbunit.dataset.NoSuchTableException: address
at
org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:223)
at
org.dbunit.database.DatabaseDataSet.getTableMetaData(DatabaseDataSet.java:223)
*


Then looking around, it seems to be failing like:

*[myproject] INFO [main] SchemaExport.execute(154) | Running hbm2ddl schema
export
[myproject] DEBUG [main] SchemaExport.execute(170) | import file not found:
/import.sql
[myproject] INFO [main] SchemaExport.execute(179) | exporting generated
schema to database
[myproject] DEBUG [main] SchemaExport.execute(303) | alter table app_user
drop foreign key FK459C57294AD68248
[myproject] DEBUG [main] SchemaExport.drop(288) | Unsuccessful: a

RE: [m2] can't get hibernate plugin to work with hsql

2008-04-27 Thread Brian E. Fox
Chapter 7 of Maven: The Definitive Guide shows a multimodule example
that happens to use Hibernate: http://www.sonatype.com/book

-Original Message-
From: Mick Knutson [mailto:[EMAIL PROTECTED] 
Sent: Saturday, April 26, 2008 10:11 AM
To: maven
Subject: [m2] can't get hibernate plugin to work with hsql

zI am trying to run hibernate to generate sql, populate my db and then
run
some tests.
Well, if I use MySql, I do not have any issues at all. But when I switch
to
hsql, i can't get the databasse tables to be created, then I get a table
not
exist error in dbunit.

Here is my hibernate plugin:

org.codehaus.mojo
hibernate3-maven-plugin
2.1



hbm2ddl

annotationconfiguration


hbm2hbmxml

src/main/resources



true

/src/main/resources/hibernate.cfg.xml
true
${maven.test.skip}




hbm2ddl
process-test-resources

hbm2ddl





${jdbc.groupId}
${jdbc.artifactId}
${jdbc.version}




So what am I missing? Why do the tables for Mysql but with HSQL they do
not?
Also, I do not see any files generated in src/main/resources/

Here is the trace when I run hibernate alone:

[myproject] INFO [main] SchemaExport.execute(154) | Running hbm2ddl
schema
export
[myproject] DEBUG [main] SchemaExport.execute(170) | import file not
found:
/import.sql
[myproject] INFO [main] SchemaExport.execute(179) | exporting generated
schema to database
[myproject] INFO [main] DriverManagerConnectionProvider.configure(41) |
Using Hibernate built-in connection pool (not for production use!)
[myproject] INFO [main] DriverManagerConnectionProvider.configure(42) |
Hibernate connection pool size: 20
[myproject] INFO [main] DriverManagerConnectionProvider.configure(45) |
autocommit mode: false
[myproject] INFO [main] DriverManagerConnectionProvider.configure(80) |
using driver: org.hsqldb.jdbcDriver at URL:
jdbc:hsqldb:file:target/testd
b-hsql;shutdown=true
[myproject] INFO [main] DriverManagerConnectionProvider.configure(83) |
connection properties: {user=sa, password=}
[myproject] DEBUG [main]
DriverManagerConnectionProvider.getConnection(93) |
total checked-out connections: 0
[myproject] DEBUG [main]
DriverManagerConnectionProvider.getConnection(109)
| opening new JDBC connection
[myproject] DEBUG [main]
DriverManagerConnectionProvider.getConnection(115)
| created connection to: jdbc:hsqldb:file:target/testdb-hsql;shutdown
=true, Isolation Level: 2
alter table app_user drop constraint FK459C57294AD68248;
[myproject] DEBUG [main] SchemaExport.execute(303) | alter table
app_user
drop constraint FK459C57294AD68248;
[myproject] DEBUG [main] SchemaExport.drop(288) | Unsuccessful: alter
table
app_user drop constraint FK459C57294AD68248
[myproject] DEBUG [main] SchemaExport.drop(289) | Table not found:
APP_USER
in statement [alter table app_user]
alter table user_role drop constraint FK143BF46AE8EA6EF6;
[myproject] DEBUG [main] SchemaExport.execute(303) | alter table
user_role
drop constraint FK143BF46AE8EA6EF6;
[myproject] DEBUG [main] SchemaExport.drop(288) | Unsuccessful: alter
table
user_role drop constraint FK143BF46AE8EA6EF6
[myproject] DEBUG [main] SchemaExport.drop(289) | Table not found:
USER_ROLE
in statement [alter table user_role]
alter table user_role drop constraint FK143BF46A43BFAB16;
[myproject] DEBUG [main] SchemaExport.execute(303) | alter table
user_role
drop constraint FK143BF46A43BFAB16;
[myproject] DEBUG [main] SchemaExport.drop(288) | Unsuccessful: alter
table
user_role drop constraint FK143BF46A43BFAB16
[myproject] DEBUG [main] SchemaExport.drop(289) | Table not found:
USER_ROLE
in statement [alter table user_role]
drop table address if exists;
[myproject] DEBUG [main] SchemaExport.execute(303) | drop table address
if
exists;
drop table app_user if exists;
[myproject] DEBUG [main] SchemaExport.execute(303) | drop table app_user
if
exists;
drop table role if exists;
[myproject] DEBUG [main] SchemaExport.execute(303) | drop table role if
exists;
drop table user_role if exists;
[myproject] DEBUG [main] SchemaExport.execute(303) | drop table
user_role if
exists;
create table address (id bigint generated by default as identity (start
with
1), version integer, address varchar(25) not null, city varchar(25)
not null, country varchar(2) not null, postal_code varchar(25) not null,
province varchar(

Re: [m2] can't get hibernate plugin to work with hsql

2008-04-26 Thread Mick Knutson
This is the hsql.properties that was generated:
#HSQL Database Engine 1.8.0.5
#Sat Apr 26 07:57:59 PDT 2008
hsqldb.script_format=0
runtime.gc_interval=0
sql.enforce_strict_size=false
hsqldb.cache_size_scale=8
readonly=false
hsqldb.nio_data_file=true
hsqldb.cache_scale=14
version=1.8.0
hsqldb.default_table_type=memory
hsqldb.cache_file_scale=1
hsqldb.log_size=200
modified=no
hsqldb.cache_version=1.7.0
hsqldb.original_version=1.8.0
hsqldb.compatible_version=1.8.0


And here is the hsql.script that is generated:

CREATE SCHEMA PUBLIC AUTHORIZATION DBA
CREATE MEMORY TABLE ADDRESS(ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START
WITH 1) NOT NULL PRIMARY KEY,VERSION INTEGER,ADDRESS VARCHAR(25) NOT
NULL,CITY VARCHAR(25) NOT NULL,COUNTRY VARCHAR(2) NOT NULL,POSTAL_CODE
VARCHAR(25) NOT NULL,PROVINCE VARCHAR(25) NOT NULL)
CREATE MEMORY TABLE APP_USER(ID BIGINT GENERATED BY DEFAULT AS
IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,VERSION INTEGER,CONFIRMPASSWORD
VARCHAR(255),EMAIL VARCHAR(50) NOT NULL,FIRST_NAME VARCHAR(50) NOT
NULL,LAST_NAME VARCHAR(50) NOT NULL,MIDDLE_NAME VARCHAR(50),PASSWORD
VARCHAR(100) NOT NULL,PASSWORD_HINT VARCHAR(50),PHONE_NUMBER
VARCHAR(25),USERNAME VARCHAR(25) NOT NULL,WEBSITE VARCHAR(50),ADDRESS_FK
BIGINT,CONSTRAINT FK459C57294AD68248 FOREIGN KEY(ADDRESS_FK) REFERENCES
ADDRESS(ID))
CREATE MEMORY TABLE ROLE(ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START
WITH 1) NOT NULL PRIMARY KEY,VERSION INTEGER,DESCRIPTION VARCHAR(255) NOT
NULL,NAME VARCHAR(64) NOT NULL)
CREATE MEMORY TABLE USER_ROLE(USER_ID BIGINT NOT NULL,ROLE_ID BIGINT NOT
NULL,PRIMARY KEY(USER_ID,ROLE_ID),CONSTRAINT FK143BF46AE8EA6EF6 FOREIGN
KEY(USER_ID) REFERENCES APP_USER(ID),CONSTRAINT FK143BF46A43BFAB16 FOREIGN
KEY(ROLE_ID) REFERENCES ROLE(ID))
ALTER TABLE ADDRESS ALTER COLUMN ID RESTART WITH 1
ALTER TABLE APP_USER ALTER COLUMN ID RESTART WITH 1
ALTER TABLE ROLE ALTER COLUMN ID RESTART WITH 1
CREATE USER SA PASSWORD ""
GRANT DBA TO SA
SET WRITE_DELAY 10





On Sat, Apr 26, 2008 at 7:11 AM, Mick Knutson <[EMAIL PROTECTED]> wrote:

> zI am trying to run hibernate to generate sql, populate my db and then run
> some tests.
> Well, if I use MySql, I do not have any issues at all. But when I switch
> to hsql, i can't get the databasse tables to be created, then I get a table
> not exist error in dbunit.
>
> Here is my hibernate plugin:
> 
> org.codehaus.mojo
> hibernate3-maven-plugin
> 2.1
> 
> 
> 
> hbm2ddl
>
> annotationconfiguration
> 
> 
> hbm2hbmxml
>
> src/main/resources
> 
> 
> 
> true
>
> /src/main/resources/hibernate.cfg.xml
> true
> ${maven.test.skip}
> 
> 
> 
> 
> hbm2ddl
> process-test-resources
> 
> hbm2ddl
> 
> 
> 
> 
> 
> ${jdbc.groupId}
> ${jdbc.artifactId}
> ${jdbc.version}
> 
> 
> 
>
> So what am I missing? Why do the tables for Mysql but with HSQL they do
> not?
> Also, I do not see any files generated in src/main/resources/
>
> Here is the trace when I run hibernate alone:
>
> [myproject] INFO [main] SchemaExport.execute(154) | Running hbm2ddl schema
> export
> [myproject] DEBUG [main] SchemaExport.execute(170) | import file not
> found: /import.sql
> [myproject] INFO [main] SchemaExport.execute(179) | exporting generated
> schema to database
> [myproject] INFO [main] DriverManagerConnectionProvider.configure(41) |
> Using Hibernate built-in connection pool (not for production use!)
> [myproject] INFO [main] DriverManagerConnectionProvider.configure(42) |
> Hibernate connection pool size: 20
> [myproject] INFO [main] DriverManagerConnectionProvider.configure(45) |
> autocommit mode: false
> [myproject] INFO [main] DriverManagerConnectionProvider.configure(80) |
> using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:file:target/testd
> b-hsql;shutdown=true
> [myproject] INFO [main] DriverManagerConnectionProvider.configure(83) |
> connection properties: {user=sa, password=}
> [myproject] DEBUG [main] DriverManagerConnectionProvider.getConnection(93)
> | total checked-out connections: 0
> [myproject] DEBUG [main]
> DriverManagerConnectionProvider.getConnection(109) | opening new JDBC
> connection
> [myproject] DEBUG [main]
> DriverManagerConnectionProvider.getConnection(115) | created connection to:
> jdbc:hsqldb:file:target/testdb-hsql;shutdown
> =true, Isolation Level: 2
> alte