-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: DB2 iSeries - The driver does not support this function.
PostPosted: Thu Mar 09, 2006 11:31 am 
Newbie

Joined: Thu Mar 09, 2006 11:19 am
Posts: 5
Hi,

I hope someone can help me. I am new to Hibernate and I am trying to set up the example program eg (the Auction example).

When test data is being inserted I get the following exception (The driver does not support this function). I am using the jt400.jar for DB2 on iSeries.

Does anyone know what this means, what the driver does not support?
When I use the same driver and write code that inserts into the database with the same insert statement it works fine.

Thank you in advance for any comments.

dorag

More information below:

Hibernate version:3.1.2

Full stack trace of any exception that occurs:

[java] Setting up some test data
[java] Hibernate:
[java] /* insert org.hibernate.auction.User
[java] */ insert
[java] into
[java] AuctionUser
[java] (userName, "password", email, firstName, "initial", las
Name, id)
[java] values
[java] (?, ?, ?, ?, ?, ?, default)
[java] 14:56:47,726 WARN JDBCExceptionReporter:71 - SQL Error: -99999, SQ
State: IM001
[java] 14:56:47,726 ERROR JDBCExceptionReporter:72 - The driver does not s
pport this function.
[java] org.hibernate.exception.GenericJDBCException: could not insert: [or
.hibernate.auction.User]
[java] at org.hibernate.exception.SQLStateConverter.handledNonSpecific
xception(SQLStateConverter.java:91)
[java] at org.hibernate.exception.SQLStateConverter.convert(SQLStateCo
verter.java:79)
[java] at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExce
tionHelper.java:43)
[java] at org.hibernate.persister.entity.AbstractEntityPersister.inser
(AbstractEntityPersister.java:1986)
[java] at org.hibernate.persister.entity.AbstractEntityPersister.inser
(AbstractEntityPersister.java:2405)
[java] at org.hibernate.action.EntityIdentityInsertAction.execute(Enti
yIdentityInsertAction.java:37)
[java] at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:24
)
[java] at org.hibernate.event.def.AbstractSaveEventListener.performSav
OrReplicate(AbstractSaveEventListener.java:269)
[java] at org.hibernate.event.def.AbstractSaveEventListener.performSav
(AbstractSaveEventListener.java:167)
[java] at org.hibernate.event.def.AbstractSaveEventListener.saveWithGe
eratedId(AbstractSaveEventListener.java:101)
[java] at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.sav
WithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
[java] at org.hibernate.event.def.DefaultSaveEventListener.saveWithGen
ratedOrRequestedId(DefaultSaveEventListener.java:33)
[java] at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.ent
tyIsTransient(DefaultSaveOrUpdateEventListener.java:175)
[java] at org.hibernate.event.def.DefaultSaveEventListener.performSave
rUpdate(DefaultSaveEventListener.java:27)
[java] at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onS
veOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
[java] at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:559

[java] at org.hibernate.impl.SessionImpl.save(SessionImpl.java:547)
[java] at org.hibernate.impl.SessionImpl.save(SessionImpl.java:543)
[java] at org.hibernate.auction.Main.createTestAuctions(Main.java:293)
[java] at org.hibernate.auction.Main.main(Main.java:370)
[java] Caused by: java.sql.SQLException: The driver does not support this
unction.
[java] at com.ibm.as400.access.JDError.throwSQLException(JDError.java:
95)
[java] at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS
00JDBCConnection.java:1945)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sour
e)
[java] at java.lang.reflect.Method.invoke(Unknown Source)
[java] at org.hibernate.util.GetGeneratedKeysHelper.prepareStatement(G
tGeneratedKeysHelper.java:45)
[java] at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(Abst
actBatcher.java:435)
[java] at org.hibernate.jdbc.AbstractBatcher.prepareStatement(Abstract
atcher.java:93)
[java] at org.hibernate.persister.entity.AbstractEntityPersister.inser
(AbstractEntityPersister.java:1948)
[java] ... 16 more
[java] Exception in thread "main"

BUILD FAILED
C:\Program Files\Hibernate\hibernate-3.1.2\hibernate-3.1\build.xml:707: Java re
urned: 1


Name and version of the database you are using:DB2 on iSeries


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 17, 2006 9:07 am 
Newbie

Joined: Thu Mar 09, 2006 11:19 am
Posts: 5
No replies yet :(

Does this have to do with the built-in Connection Pool?

Hope someone can help me because it doesn't matter if I run another hibernate application, have tried a few versions.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 17, 2006 11:25 am 
Pro
Pro

Joined: Mon Jan 24, 2005 5:39 am
Posts: 216
Location: Germany
Some remarks:

1. [java] /* insert org.hibernate.auction.User
[java] */ insert

This looks like an SQL comment, I never used this feature.
Perhaps you can turn it off somehow ?

2. Do you use the correct Dialect class ?

3. Does the same code work on a PC with a lokal Db2 installation ?

_________________
dont forget to rate !


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 17, 2006 11:31 am 
Newbie

Joined: Thu Mar 09, 2006 11:19 am
Posts: 5
Thank you for the reply.

I don't have a local installation of DB2.

It seems that the driver does not support the prepared statement. I read somewhere that some drivers do not support the JDBC3 getGeneratedKeys so I put the property jdbc.use_get_generated_keys false.

Now my exception is that the [TABLENAME] in [SCHEMANAME] not valid for operation.

Are you using DB2 on iSeries??


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 17, 2006 11:46 am 
Newbie

Joined: Thu Mar 09, 2006 11:19 am
Posts: 5
The second exception was because the table is not journalled. When I put connection.isolation 0 it works.

Problem solved! for now.

Thank you!


Top
 Profile  
 
 Post subject: It worked in 3.0.5 but failed in 3.1.2
PostPosted: Tue Mar 28, 2006 2:54 pm 
Newbie

Joined: Tue Mar 28, 2006 2:48 pm
Posts: 1
I had the exact same problem and journaling was on. The primary key column is an identity type. The JTOpen driver does support JDBC getGeneratedKeys. I wonder if newer version of hibernate tries to get key differently.

_________________
YG


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 29, 2006 4:44 am 
Newbie

Joined: Thu Mar 09, 2006 11:19 am
Posts: 5
Does getGeneratedKeys work for you? I am using the latest version of the driver from JTOpen.

I have not had any more difficulties yet but if you think I can help you then I will try to :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.