-->
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.  [ 1 post ] 
Author Message
 Post subject: SAPDB select .. for update probleme
PostPosted: Fri Apr 28, 2006 7:25 am 
Newbie

Joined: Tue Nov 02, 2004 12:48 pm
Posts: 7
Location: Bamberg / Germany
Hi ,
I have the following probleme, I tried to make
select .. for update in SAPDB and get the Exception below.

Can anyone help me. What did I wrong

I tested it with the following code:


HibernateUtil.createNewSession();
Session s = HibernateUtil.getSession();
HibernateUtil.beginTransaction();
s.get(Student.class, new Integer(1), LockMode.UPGRADE);
HibernateUtil.commitTransaction();
s.close();

Many thanks for helping

Gerlinde

Hibernate version: 3.2.0.CR1

Mapping documents:

<hibernate-configuration>
<session-factory>

<!-- Don't forget to copy your JDBC driver to the lib/ directory! -->

<!-- Settings for a SapDB database. -->

<property name="dialect">net.sf.hibernate.dialect.SAPDBDialect</property>
<property name="connection.driver_class">com.sap.dbtech.jdbc.DriverSapDB</property>
<property name="connection.url">jdbc:sapdb://localhost/TEST</property>
<property name="connection.username">????</property>
<property name="connection.password">????</property>


<!-- Use the C3P0 connection pool.-->
<property name="c3p0.min_size">3</property>
<property name="c3p0.max_size">5</property>
<property name="c3p0.timeout">1800</property>


<!-- Use the Hibernate built-in pool for tests. -->
<property name="connection.pool_size">1</property>

<!-- Use EHCache but not the query cache. -->
<property name="cache.provider_class">net.sf.ehcache.hibernate.Provider</property>
<property name="cache.use_query_cache">false</property>
<property name="cache.use_minimal_puts">false</property>

<!-- Print SQL to stdout. -->
<property name="show_sql">true</property>

<!-- FN2 mapping files. -->
<!-- org -->
<mapping resource="de/ihb/flexnow/kogen/Land.hbm.xml"/>
<mapping resource="de/ihb/flexnow/kogen/Univ.hbm.xml"/>
<mapping resource="de/ihb/flexnow/kogen/Zeiteinheit.hbm.xml"/>


Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

27.04.2006 10:19:26 org.hibernate.util.JDBCExceptionReporter logExceptions
WARNUNG: SQL Error: -5015, SQLState: 42000
27.04.2006 10:19:26 org.hibernate.util.JDBCExceptionReporter logExceptions
SCHWERWIEGEND: [-5015] (at 1757): Missing keyword:OF
27.04.2006 10:19:26 org.hibernate.event.def.DefaultLoadEventListener onLoad
INFO: Error performing load command
org.hibernate.exception.SQLGrammarException: could not load an entity: [de.ihb.flexnow.ko.std.Student#1]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1799)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2821)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:365)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:346)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:123)
at org.hibernate.event.def.DefaultLoadEventListener.lockAndLoad(DefaultLoadEventListener.java:272)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:90)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:866)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:857)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:852)
at test.main(test.java:42)
Caused by: com.sap.dbtech.jdbc.exceptions.DatabaseException: [-5015] (at 1757): Missing keyword:OF
at com.sap.dbtech.jdbc.packet.ReplyPacket.createException(ReplyPacket.java:69)
at com.sap.dbtech.jdbc.ConnectionSapDB.throwSQLError(ConnectionSapDB.java:768)
at com.sap.dbtech.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:434)
at com.sap.dbtech.jdbc.CallableStatementSapDB.sendCommand(CallableStatementSapDB.java:1498)
at com.sap.dbtech.jdbc.StatementSapDB.sendSQL(StatementSapDB.java:725)
at com.sap.dbtech.jdbc.CallableStatementSapDB.doParse(CallableStatementSapDB.java:224)
at com.sap.dbtech.jdbc.CallableStatementSapDB.constructor(CallableStatementSapDB.java:175)
at com.sap.dbtech.jdbc.CallableStatementSapDB.<init>(CallableStatementSapDB.java:79)
at com.sap.dbtech.jdbc.ConnectionSapDB.prepareStatement(ConnectionSapDB.java:660)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.mchange.v2.c3p0.stmt.GooGooStatementCache$3.run(GooGooStatementCache.java:445)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:368)
Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not load an entity: [de.ihb.flexnow.ko.std.Student#1]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1799)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2821)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:365)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:346)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:123)
at org.hibernate.event.def.DefaultLoadEventListener.lockAndLoad(DefaultLoadEventListener.java:272)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:90)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:866)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:857)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:852)
at test.main(test.java:42)
Caused by: com.sap.dbtech.jdbc.exceptions.DatabaseException: [-5015] (at 1757): Missing keyword:OF
at com.sap.dbtech.jdbc.packet.ReplyPacket.createException(ReplyPacket.java:69)
at com.sap.dbtech.jdbc.ConnectionSapDB.throwSQLError(ConnectionSapDB.java:768)
at com.sap.dbtech.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:434)
at com.sap.dbtech.jdbc.CallableStatementSapDB.sendCommand(CallableStatementSapDB.java:1498)
at com.sap.dbtech.jdbc.StatementSapDB.sendSQL(StatementSapDB.java:725)
at com.sap.dbtech.jdbc.CallableStatementSapDB.doParse(CallableStatementSapDB.java:224)
at com.sap.dbtech.jdbc.CallableStatementSapDB.constructor(CallableStatementSapDB.java:175)
at com.sap.dbtech.jdbc.CallableStatementSapDB.<init>(CallableStatementSapDB.java:79)
at com.sap.dbtech.jdbc.ConnectionSapDB.prepareStatement(ConnectionSapDB.java:660)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.mchange.v2.c3p0.stmt.GooGooStatementCache$3.run(GooGooStatementCache.java:445)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:368)

Name and version of the database you are using:
SAPDB 7.3

The generated SQL (show_sql=true):

select student0_.MATRNR as MATRNR144_0_, student0_.VORNAME as VORNAME144_0_, student0_.NACHNAME as NACHNAME144_0_, student0_.NUTZER as NUTZER144_0_, student0_.ORT1 as ORT5_144_0_, student0_.STRASSE1 as STRASSE6_144_0_, student0_.VERMIETER1 as VERMIETER7_144_0_, student0_.GEBDAT as GEBDAT144_0_, student0_.PASSWORT as PASSWORT144_0_, student0_.PASSWORTAKTIV as PASSWOR10_144_0_, student0_.GORT as GORT144_0_, student0_.GNAME as GNAME144_0_, student0_.GDATUM as GDATUM144_0_, student0_.EMAIL as EMAIL144_0_, student0_.PLZ1 as PLZ15_144_0_, student0_.ZEITSTEMPEL as ZEITSTE16_144_0_, student0_.TELEFON1 as TELEFON17_144_0_, student0_.TELEFON2 as TELEFON18_144_0_, student0_.ORT2 as ORT19_144_0_, student0_.STRASSE2 as STRASSE20_144_0_, student0_.VERMIETER2 as VERMIETER21_144_0_, student0_.PLZ2 as PLZ22_144_0_, student0_.POSTADRESSE as POSTADR23_144_0_, student0_.NACHNAMEASCII as NACHNAM24_144_0_, student0_.LAND1 as LAND25_144_0_, student0_.LAND2 as LAND26_144_0_, student0_.HOMEVERZEICHNIS as HOMEVER27_144_0_, student0_.AKADGRAD as AKADGRAD144_0_, student0_.MATRNRSTR as MATRNRSTR144_0_, student0_.BAFOEG as BAFOEG144_0_, student0_.NUTZERNAME as NUTZERNAME144_0_, student0_.ANZAHLTAN as ANZAHLTAN144_0_, student0_.PASSWORTAENDERN as PASSWOR33_144_0_, student0_.PASSWORTDATUM as PASSWOR34_144_0_, student0_.NDSNUTZER as NDSNUTZER144_0_, student0_.NAMENSZUSATZ as NAMENSZ36_144_0_, student0_.FREISCHALTUNG as FREISCH37_144_0_, student0_.GLAND as GLAND144_0_, student0_.HZB_NOTE as HZB39_144_0_, student0_.HZB_ART as HZB40_144_0_, student0_.PERSONID as PERSONID144_0_, student0_.ORGEINHEIT as ORGEINHEIT144_0_, student0_.UNIV as UNIV144_0_, student0_.SEX as SEX144_0_, student0_.LAND as LAND144_0_ from STUDENT student0_ where student0_.MATRNR=? for update

Debug level Hibernate log excerpt:


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

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.