-->
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.  [ 5 posts ] 
Author Message
 Post subject: @GenericGenerator strategy = increment Identifier too long
PostPosted: Thu Jan 25, 2007 6:57 am 
Beginner
Beginner

Joined: Mon Jan 22, 2007 1:16 pm
Posts: 21
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)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 29, 2007 4:00 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I think increment generator requires a long and it's equivalent at the db level

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 30, 2007 9:42 am 
Beginner
Beginner

Joined: Mon Jan 22, 2007 1:16 pm
Posts: 21
thanks for the response Emmanuel.

That's what I was afraid of. Unfortunately, the DB I am using(SQLBase) doesn't have long and the longest number I can create there still isn't long enough. No matter what numeric type I try to use on the DB side, I get the 'Identifier too long' error.

I also can't seem to use the other ID generators because of other limitations with SQLBase.

thanks again for responding.
-mark


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 31, 2007 12:06 pm 
Beginner
Beginner

Joined: Mon Jan 22, 2007 1:16 pm
Posts: 21
whoops. come to find out that I misinterpreted the error message.

the error message was telling me that Hibernate was trying to create an identifier name that was too long.

the increment generic generator seems to work fine with integers.

-mark


Top
 Profile  
 
 Post subject: Re: @GenericGenerator strategy = increment Identifier too long
PostPosted: Mon Nov 22, 2010 5:36 am 
Newbie

Joined: Mon Nov 22, 2010 5:26 am
Posts: 9
Hi,

I'm going to be looking at implementing NHibernate and SQLBase. Do you have any code you could post to help me out?

Thanks.

Mike.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.