AnsweredAssumed Answered

HSQLDB and 2.1.0?

Question asked by rob.golkosky on May 1, 2007
Latest reply on May 3, 2007 by britt
Hi -

I built a version of the alfresco sdk from svn (version 741 I believe, from last Friday) and I've been able to get it running with mysql with no problems.  For some of our testing, however, I was thinking it might be nice to run against hsqldb.  When starting up the application against hsqldb, I see these errors:

07:35:17,130 INFO  [domain.schema.SchemaBootstrap] Generating unmodified schema creation script: /tmp/Alfresco/AlfrescoSchemaCreate-org.hibernate.dialect.HSQLDialect-35750.sql
07:35:17,235 INFO  [domain.schema.SchemaBootstrap] Executing database script: /tmp/Alfresco/AlfrescoSchemaCreate-org.hibernate.dialect.HSQLDialect-35750.sql
07:35:17,363 INFO  [domain.schema.SchemaBootstrap] Executing database script: classpath:alfresco/dbscripts/create/2.0/${db.script.dialect}/AlfrescoPostCreate-2.0-FKIndexes.sql
07:35:17,955 ERROR [web.context.ContextLoader] Context initialization failed
org.hibernate.exception.GenericJDBCException: could not insert: [org.alfresco.repo.attributes.MapAttributeImpl]
        at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:40)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2108)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2588)
        at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
        at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
        at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:290)
        at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:180)
        at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:108)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
        at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
        at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
        at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
        at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
        at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
        at org.alfresco.repo.attributes.hibernate.AttributeDAOHibernate.save(AttributeDAOHibernate.java:133)
        at org.alfresco.repo.attributes.MapAttributeImpl.<init>(MapAttributeImpl.java:56)
        at org.alfresco.repo.attributes.AttributeConverter.toPersistent(AttributeConverter.java:84)
Caused by: java.sql.SQLException: This function is not supported
        at org.hsqldb.jdbc.Util.sqlException(Lorg.hsqldb.HsqlException;)Ljava.sql.SQLException;(Unknown Source)
        at org.hsqldb.jdbc.Util.notSupported()Ljava.sql.SQLException;(Unknown Source)
        at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Ljava.lang.String;I)Ljava.sql.PreparedStatement;(Unknown Source)        at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:394)
        at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:370)
        at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
        at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
        at org.hibernate.util.GetGeneratedKeysHelper.prepareStatement(GetGeneratedKeysHelper.java:49)
        at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:487)
        at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:94)
        at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.prepare(IdentityGenerator.java:69)
        at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:30)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2108)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2588)
        at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
        at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
        at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:290)
        at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:180)
        at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:108)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
        at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
        at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
        at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)


So this would be with spring 2.0.2, hibernate 3.2.1 and hsqldb 1.8.0.  The only configuration I touched when flipping from mysql to hsql was in custom-hibernate-dialect.properties and custom-repository.properties.

my db settings are now:

hibernate.dialect=org.hibernate.dialect.HSQLDialect

db.username=sa
db.password=
db.pool.initial=10
db.pool.max=100

db.schema.update=true
                                                                                                                                                                   
#
# HSQL connection
#
db.driver=org.hsqldb.jdbcDriver
db.url=jdbc:hsqldb:file:/tmp/test/hsql_data/alfresco;ifexists=false;shutdown=true;


Any clues?

Thanks

Outcomes