Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate configuration issue with DB2Dialect

 
Mr. Ram
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Our application is throwing the following error due to some incompatible issues with DB2Dialect.

2011-11-29 11:03:10,638 ERROR java.lang.UnsupportedOperationException: dialect does not support GUIDs
at org.hibernate.dialect.Dialect.getSelectGUIDString(Dialect.java:754)
at org.hibernate.id.GUIDGenerator.generate(GUIDGenerator.java:50)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:122)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)


The issue seems to be related to the following entry in hibernate xml files.


*) We would like to know the common <generator> element which is compatible with ORACLE and DB2, etc.
*) We would like to know how to separate the hbm configurations based on database (ORACLE, DB2, MYSQL, etc.).
 
Mr. Ram
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have fixed the issue by making customized class as follows.

 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!