File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate3.5.6 problem with HSQLDB-2.1.0 dialect

 
K Mansoor
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All-

Has anyone found a problem using Hibernate3.5.6 with HSQL-2.1.0? It appears as though hibernate is not understanding the dialect. I have a simple entity in my application, hibernate emits the following DDL (and the error it encounters)



I think HSQLDB automatically creates a primary key for an identity column and hence this collision.
Any help will be greatly appreciated.
 
Arun Kumarr
Ranch Hand
Posts: 661
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To me the problem sounds like you are trying to insert a row with primary key column value which is already present in the database.
Please verify what type of primary key column you are having and what are the primary key generation strategies deployed by hibernate.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure that's what it is. Hibernate doesn't insert rows as part of its DDL.

It does sound like the HSQL dialect doesn't know about the automatic PK generation. You can confirm (and fix) this by looking at the source. Have you checked the Hibernate JIRA?
 
Arun Kumarr
Ranch Hand
Posts: 661
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mea culpa. I didn't see the create faculty before that.
Yes, It seems like the "identity" key word manages to make the id column a primary key and explicitly doing another "primary key(id)" is throwing the error. Did you try running the DDL directly removing the "primary key(id)"? Any luck.
 
K Mansoor
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I took the Hibernate generated DDL, removed the primary key clause and ran. It ran fine AND a unique index was (automatically) created by HSQL for me on the id (which is an identity column).
 
K Mansoor
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arun Kumarr wrote:To me the problem sounds like you are trying to insert a row with primary key column value which is already present in the database.
Please verify what type of primary key column you are having and what are the primary key generation strategies deployed by hibernate.


I'm not inserting any rows. This error shows up when tomcat starts and tries to load my web app. The error comes from DDL, not DML.
Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic