Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Autoincrement column in iSeries & Hibernate (URGENT)

 
Abhijeet Kenjale
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am facing problem on iSeries using autoincrement columns.

Version(s)
==========
Hibernate : 3.0
iSeries : V5R4

Problem
=======
If I execute the INSERT SQL on table having autoincrement column, then its working fine. But when I am trying to insert record into the same table using Hibernate, I am getting following error.


[10/31/07 9:27:41:600 UTC] 0000002a JDBCException W org.apache.commons.logging.impl.Jdk14Logger warn SQL Error: -99999, SQLState: IM001
[10/31/07 9:27:41:610 UTC] 0000002a JDBCException E org.apache.commons.logging.impl.Jdk14Logger error The driver does not support this function.


So far I have tried following dialect :-

1. org.hibernate.dialect.DB2Dialect
2. org.hibernate.dialect.DB2400Dialect
3. net.sf.hibernate.dialect.DB2400V5R2Dialect

Please help me in resolving this problem. Thanks in advance.

- Abhijeet
 
Shailesh Kini
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Abhijeet,

What scheme are you using for the autogenerated ID column? What are you using for @GeneratedValue annotation?

You could also add the following
@Column(name="YOUR IDENTITY COLUMN", insertable=false, updateable=false)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic