• 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.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic