Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.2 ga (2006-04)
Full stack trace of any exception that occurs:
[ERROR .AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.exception.DataException: could not insert: [de.kontorist.core.bo.konto.Konto]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2202)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2595)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:51)
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 de.kontorist.db.HibernateUtil.save(HibernateUtil.java:563)
at de.kontorist.db.HibernateUtil.save(HibernateUtil.java:543)
at de.kontorist.db.HibernateModul.receiveMessage(HibernateModul.java:138)
at net.sf.genuine.organizer.internal.DefaultChannel$1.run(DefaultChannel.java:106)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at de.kontorist.util.JDesktopPaneStrgTab$MyEventQueue.dispatchEvent(JDesktopPaneStrgTab.java:165)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.sql.SQLException: An attempt was made to get a data value of type 'CHAR' from a data value of type 'java.lang.Character'.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.dataTypeConversion(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.setObject(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.setObject(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.setObject(Unknown Source)
at de.kontorist.db.KontoristEnum.nullSafeSet(KontoristEnum.java:334)
at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:146)
at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:1932)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2178)
... 22 more
Name and version of the database you are using: Derby 10.2.1.6 (2006-10)
The generated SQL (show_sql=true):
Hibernate: insert into "Konto" (kontoart, "FK_Kontengruppe", "bezeichnung", "FK_Steuersatz", "nr", "id") values (?, ?, ?, ?, ?, ?)
***********************************************
Hi, my problem is "kontoart" - a UserType (Character Enum). It works fine with MySQL and HSQLDB, but Derby dosnt work.
Has onyone a idea what to do?
kind regards
Martin