-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: IdGenerator fails with Hibernate 4 and HSQLDB 1.8
PostPosted: Wed Jan 04, 2012 4:01 am 
Newbie

Joined: Fri Jun 17, 2005 2:07 am
Posts: 19
Location: Berne, Switzerland
hi,

after switching from Hibernate 3.6.4 to 4.0.0 i can no longer use the idGenerator with hsqldb 1.8
the mapping is as follows:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
   "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
   
   <class name="test.events.Cat" table="CAT">
      
      <id name="id">
         <column name="CAT_ID" not-null="true"/>
         <generator class="identity"/>
      </id>
            
      <property name="name">
         <column name="NAME" not-null="true"/>
      </property>
      
      <property name="sex"/>
            
       <property name="geburtstag"/>
      
   </class>
   
</hibernate-mapping>


when inserting an object i get the following exception:

Code:
Hibernate: drop table CAT if exists
08:52:53,116 DEBUG SQL:104 - create table CAT (CAT_ID bigint generated by default as identity (start with 1), NAME varchar(255) not null, sex varchar(255), geburtstag timestamp, primary key (CAT_ID))
Hibernate: create table CAT (CAT_ID bigint generated by default as identity (start with 1), NAME varchar(255) not null, sex varchar(255), geburtstag timestamp, primary key (CAT_ID))
08:52:53,116  INFO SchemaExport:406 - HHH000230: Schema export complete
08:52:53,116 DEBUG SessionFactoryImpl:960 - Checking 0 named HQL queries
08:52:53,116 DEBUG SessionFactoryImpl:981 - Checking 0 named SQL queries
08:52:53,116 DEBUG StatisticsInitiator:110 - Statistics initialized [enabled=false]
08:52:53,163 DEBUG SessionImpl:243 - Opened session at timestamp: 13256635731
08:52:53,163 DEBUG AbstractTransactionImpl:158 - begin
08:52:53,163 DEBUG LogicalConnectionImpl:295 - Obtaining JDBC connection
08:52:53,163 DEBUG LogicalConnectionImpl:301 - Obtained JDBC connection
08:52:53,163 DEBUG JdbcTransaction:69 - initial autocommit status: false
08:52:53,226 DEBUG AbstractSaveEventListener:303 - Executing identity-insert immediately
08:52:53,242 DEBUG SqlExceptionHelper:139 - This function is not supported [n/a]
java.sql.SQLException: This function is not supported
   at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
   at org.hsqldb.jdbc.Util.notSupported(Unknown Source)
   at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
   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 org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.continueInvocation(ConnectionProxyHandler.java:138)
   at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
   at $Proxy4.prepareStatement(Unknown Source)
   at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$2.doPrepare(StatementPreparerImpl.java:105)
   at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:166)
   at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareStatement(StatementPreparerImpl.java:107)
   at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:55)
   at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2757)
   at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3268)
   at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:78)
   at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:273)
   at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:304)
   at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:195)
   at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:128)
   at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:204)
   at org.hibernate.event.internal.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:55)
   at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:189)
   at org.hibernate.event.internal.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:49)
   at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:90)
   at org.hibernate.internal.SessionImpl.fireSave(SessionImpl.java:642)
   at org.hibernate.internal.SessionImpl.save(SessionImpl.java:635)
   at org.hibernate.internal.SessionImpl.save(SessionImpl.java:631)
   at test.events.TestCat_tc.test1(TestCat_tc.java:53)
   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:168)
   at junit.framework.TestCase.runBare(TestCase.java:134)
   at junit.framework.TestResult$1.protect(TestResult.java:110)
   at junit.framework.TestResult.runProtected(TestResult.java:128)
   at junit.framework.TestResult.run(TestResult.java:113)
   at junit.framework.TestCase.run(TestCase.java:124)
   at junit.framework.TestSuite.runTest(TestSuite.java:243)
   at junit.framework.TestSuite.run(TestSuite.java:238)
   at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
   at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
   at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
08:52:53,242  WARN SqlExceptionHelper:143 - SQL Error: -20, SQLState: IM001
08:52:53,242 ERROR SqlExceptionHelper:144 - This function is not supported



jakob


Last edited by brj on Fri Jan 06, 2012 6:38 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: IdGenerator fails with Hibernate 4 and HSQLDB
PostPosted: Fri Jan 06, 2012 6:37 pm 
Newbie

Joined: Fri Jun 17, 2005 2:07 am
Posts: 19
Location: Berne, Switzerland
IdGenerator works with HSQLDB 2.0.0 and 2.2.6.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.