I think that the org.hibernate.dialect.DB2400Dialect does not work properly with Hibernate 3.1. When I try to save an object I get a "The driver does not support this function" error message. I have the latest jt400.jar file. If I use Hibernate 3.0 then it works fine. Is it possible this is a bug? What do I need to do to report this if it is a bug? Any help would be appreciated.
Hibernate version: 3.1
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
Mapping file autogenerated by MyEclipse - Hibernate Tools
-->
<hibernate-mapping package="com.idfbins.domain.busent">
<class name="James" table="James" schema="CAPROTOTYP" catalog="FBMAS270">
<id name="id" type="long">
<column name="ID" />
<generator class="native" />
</id>
<property
name="notes"
column="NOTES"
type="string"
/>
</class>
</hibernate-mapping>
Code:
Code:
James test1 = new James();
test1.setNotes("hi");
try {
//temporary only. In future transaction should begin in constructor
Transaction tx = SessionFactory.currentSession().beginTransaction();
SessionFactory.currentSession().saveOrUpdate(test1);
//temporary only. Later we will need to remove this commit and have the commit performed from the services layer.
tx.commit();
} catch (Exception ex) {
//throw new InfrastructureException(ex);
System.out.println("error" + ex.getMessage());
}
Full stack trace of any exception that occurs:14:14:05,251 DEBUG AbstractEntityPersister:1941 - Inserting entity: com.idfbins.domain.busent.James (native id)
14:14:05,251 DEBUG AbstractBatcher:311 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
14:14:05,267 DEBUG SQL:346 - insert into FBMAS270.CAPROTOTYP.James (NOTES, ID) values (?, default)
14:14:05,267 DEBUG AbstractBatcher:424 - preparing statement
14:14:05,282 DEBUG JDBCExceptionReporter:63 - could not insert: [com.idfbins.domain.busent.James] [insert into FBMAS270.CAPROTOTYP.James (NOTES, ID) values (?, default)]
java.sql.SQLException: The driver does not support this function.
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:389)
at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:1974)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.hibernate.util.GetGeneratedKeysHelper.prepareStatement(GetGeneratedKeysHelper.java:45)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:435)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:93)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1948)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2405)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:37)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:269)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:98)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:502)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:494)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:490)
at com.idfbins.domain.busent.RunTests.main(RunTests.java:194)
14:14:05,282 WARN JDBCExceptionReporter:71 - SQL Error: -99999, SQLState: IM001
14:14:05,282 ERROR JDBCExceptionReporter:72 - The driver does not support this function.
errorcould not insert: [com.idfbins.domain.busent.James]
Name and version of the database you are using:AS/400 DB2 V5R2
Code: