Hello, I am using Hibernate 3.2.1 and hibernate-annotations-3.2.1. The database is SQLBase 7.6.1 for which I have created a Dialect for.
This is what I am trying to use in my class file:
@Id @GeneratedValue(generator="pkgenerator")
@GenericGenerator(name="pkgenerator", strategy = "increment")
@Column(name = "MESSAGE_ID")
private int id;
When Hibernate tries to do an insert, I get an "Identifier too long" exception. You can see the full exception text at the end of this message.
Previous to trying Hibernate Annotations, I used the following in my .hbm.xml file and it worked as expected.
<id
name="id"
column="MESSAGE_ID">
<generator class="increment"/>
</id>
Anyone have any ideas of what's wrong or know of any workarounds ?
Here is the complete Exception text:
25 janv. 2007 11:58:26 org.hibernate.util.JDBCExceptionReporter logExceptions
ATTENTION: SQL Error: 0, SQLState: null
25 janv. 2007 11:58:26 org.hibernate.util.JDBCExceptionReporter logExceptions
GRAVE: 00910 PRS ITL Identifier too long
25 janv. 2007 11:58:26 org.hibernate.event.def.AbstractFlushingEventListener performExecutions
GRAVE: Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: could not insert: [hello.Message]
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.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2217)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2610)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:52)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at hello.HelloWorld.main(HelloWorld.java:20)
Caused by: java.sql.SQLException: 00910 PRS ITL Identifier too long
at jdbc.gupta.sqlbase.SqlbaseStatement.SQLException(SqlbaseStatement.java:834)
at jdbc.gupta.sqlbase.SqlbasePreparedStatement.<init>(SqlbasePreparedStatement.java:147)
at jdbc.gupta.sqlbase.SqlbasePreparedStatement.<init>(SqlbasePreparedStatement.java:92)
at jdbc.gupta.sqlbase.SqlbaseConnection.prepareStatement(SqlbaseConnection.java:198)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.mchange.v2.c3p0.stmt.GooGooStatementCache$3.run(GooGooStatementCache.java:445)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:368)
Exception in thread "main" org.hibernate.exception.GenericJDBCException: could not insert: [hello.Message]
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.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2217)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2610)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:52)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at hello.HelloWorld.main(HelloWorld.java:20)
Caused by: java.sql.SQLException: 00910 PRS ITL Identifier too long
at jdbc.gupta.sqlbase.SqlbaseStatement.SQLException(SqlbaseStatement.java:834)
at jdbc.gupta.sqlbase.SqlbasePreparedStatement.<init>(SqlbasePreparedStatement.java:147)
at jdbc.gupta.sqlbase.SqlbasePreparedStatement.<init>(SqlbasePreparedStatement.java:92)
at jdbc.gupta.sqlbase.SqlbaseConnection.prepareStatement(SqlbaseConnection.java:198)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.mchange.v2.c3p0.stmt.GooGooStatementCache$3.run(GooGooStatementCache.java:445)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:368)
|