-->
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.  [ 2 posts ] 
Author Message
 Post subject: MAXDB (SAPDB) Weird Problem
PostPosted: Wed May 12, 2004 11:55 pm 
Beginner
Beginner

Joined: Fri Feb 06, 2004 6:59 am
Posts: 36
Location: S
Hi all, I am having a weird problem with MaxDb and Hibernate.

My running system is hibernate 2.1.3 and MaxDb 7.0.5.8

I mapped the table correctly but the JDBC message always retrieve the following error:

Hibernate 2.1.3
loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=com.sap.dbtech.jdbc.DriverSapDB, hibernate.cglib.use_reflection_optimizer=true, hibernate.max_fetch_depth=2, hibernate.dialect=net.sf.hibernate.dialect.SAPDBDialect, hibernate.jdbc.use_streams_for_binary=true, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.jdbc.batch_size=0, hibernate.use_outer_join=true, hibernate.proxool.pool_alias=pool1, hibernate.connection.username=ernani, hibernate.connection.url=jdbc:sapdb://127.0.0.1/DEMO, hibernate.show_sql=true, hibernate.connection.password=ernani, hibernate.connection.pool_size=10}
using java.io streams to persist binary types
using CGLIB reflection optimizer
Mapping resource: com/ejm/falaserio/hibernate/Users.hbm.xml
trying to locate http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath under net/sf/hibernate/
found http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath
Mapping class: com.ejm.falaserio.hibernate.Users -> USERS
Mapped property: id -> ID, type: integer
Mapped property: userName -> USERNAME, type: string
Mapped property: password -> PASSWORD, type: string
processing one-to-many association mappings
processing one-to-one association property references
processing foreign key constraints
Using dialect: net.sf.hibernate.dialect.SAPDBDialect
Maximim outer join fetch depth: 2
Use outer join fetching: true
Using Hibernate built-in connection pool (not for production use!)
Hibernate connection pool size: 10
using driver: com.sap.dbtech.jdbc.DriverSapDB at URL: jdbc:sapdb://127.0.0.1/DEMO
connection properties: {user=ernani, password=ernani}
No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
total checked-out connections: 0
opening new JDBC connection
created connection to: jdbc:sapdb://127.0.0.1/DEMO, Isolation Level: 2
returning connection to pool, pool size: 1
Use scrollable result sets: true
Use JDBC3 getGeneratedKeys(): false
Optimize cache for minimal puts: false
echoing all SQL to stdout
Query language substitutions: {no='N', true=1, yes='Y', false=0}
cache provider: net.sf.ehcache.hibernate.Provider
instantiating and configuring caches
building session factory
instantiating session factory with properties: {java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, hibernate.connection.password=ernani, sun.boot.library.path=C:\Arquivos de programas\Java\j2re1.4.2_04\bin, java.vm.version=1.4.2_04-b05, hibernate.proxool.pool_alias=pool1, hibernate.connection.username=ernani, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=BR, sun.os.patch.level=, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\eclipse\workspace\FalaserioHibernate, java.runtime.version=1.4.2_04-b05, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=C:\Arquivos de programas\Java\j2re1.4.2_04\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\Ernani\CONFIG~1\Temp\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows XP, sun.java2d.fontpath=, java.library.path=C:\Arquivos de programas\Java\j2re1.4.2_04\bin;.;C:\WINDOWS\System32;C:\WINDOWS;c:\arquivos de programas\sdb\programs\bin;c:\arquivos de programas\sdb\programs\pgm;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem, java.specification.name=Java Platform API Specification, java.class.version=48.0, hibernate.connection.pool_size=10, java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory, os.version=5.1, user.home=C:\Documents and Settings\Ernani, user.timezone=, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.4, hibernate.connection.driver_class=com.sap.dbtech.jdbc.DriverSapDB, java.class.path=/c:/eclipse/plugins/org.eclipse.jdt.junit_3.0.0/junitsupport.jar;/c:/eclipse/plugins/org.eclipse.jdt.junit.runtime_3.0.0/junitruntime.jar;C:\eclipse\workspace\FalaserioHibernate\bin;C:\eclipse\workspace\FalaserioHibernate\lib\commons-lang-1.0.1.jar;C:\eclipse\workspace\FalaserioHibernate\lib\hibernate2.jar;C:\eclipse\workspace\FalaserioHibernate\lib\junit-3.8.1.jar;C:\eclipse\workspace\FalaserioHibernate\lib\log4j-1.2.8.jar;C:\eclipse\workspace\FalaserioHibernate\lib\dom4j-1.4.jar;C:\eclipse\workspace\FalaserioHibernate\lib\commons-logging-1.0.3.jar;C:\eclipse\workspace\FalaserioHibernate\commons-collections-2.1.jar;C:\eclipse\workspace\FalaserioHibernate\lib\sapdbc-7_5_01_00.jar;C:\eclipse\workspace\FalaserioHibernate\ehcache-0.7.jar;C:\eclipse\workspace\FalaserioHibernate\cglib-full-2.0.1.jar;C:\eclipse\workspace\FalaserioHibernate\src\jta.jar, user.name=Ernani, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.show_sql=true, java.vm.specification.version=1.0, java.home=C:\Arquivos de programas\Java\j2re1.4.2_04, sun.arch.data.model=32, hibernate.dialect=net.sf.hibernate.dialect.SAPDBDialect, hibernate.connection.url=jdbc:sapdb://127.0.0.1/DEMO, user.language=pt, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, hibernate.cglib.use_reflection_optimizer=true, java.vm.info=mixed mode, hibernate.jdbc.use_streams_for_binary=true, java.version=1.4.2_04, java.ext.dirs=C:\Arquivos de programas\Java\j2re1.4.2_04\lib\ext, sun.boot.class.path=C:\Arquivos de programas\Java\j2re1.4.2_04\lib\rt.jar;C:\Arquivos de programas\Java\j2re1.4.2_04\lib\i18n.jar;C:\Arquivos de programas\Java\j2re1.4.2_04\lib\sunrsasign.jar;C:\Arquivos de programas\Java\j2re1.4.2_04\lib\jsse.jar;C:\Arquivos de programas\Java\j2re1.4.2_04\lib\jce.jar;C:\Arquivos de programas\Java\j2re1.4.2_04\lib\charsets.jar;C:\Arquivos de programas\Java\j2re1.4.2_04\classes, java.vendor=Sun Microsystems Inc., hibernate.jdbc.batch_size=0, file.separator=\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, sun.io.unicode.encoding=UnicodeLittle, sun.cpu.endian=little, hibernate.use_outer_join=true, hibernate.max_fetch_depth=2, sun.cpu.isalist=pentium i486 i386}
initializing class SessionFactoryObjectFactory
registered: 8a808081fc7c7b9500fc7c7b98f50000 (unnamed)
no JNDI name configured
instantiated session factory
opened session
total checked-out connections: 0
using pooled JDBC connection, pool size: 0
opened session
loading [com.ejm.falaserio.hibernate.Users#1]
attempting to resolve [com.ejm.falaserio.hibernate.Users#1]
object not resolved in any cache [com.ejm.falaserio.hibernate.Users#1]
Materializing entity: [com.ejm.falaserio.hibernate.Users#1]
about to open: 0 open PreparedStatements, 0 open ResultSets
total checked-out connections: 1
opening new JDBC connection
created connection to: jdbc:sapdb://127.0.0.1/DEMO, Isolation Level: 2
select users0_.ID as ID0_, users0_.USERNAME as USERNAME0_, users0_.PASSWORD as PASSWORD0_ from USERS users0_ where users0_.ID=?
Hibernate: select users0_.ID as ID0_, users0_.USERNAME as USERNAME0_, users0_.PASSWORD as PASSWORD0_ from USERS users0_ where users0_.ID=?
preparing statement
SQL Exception
com.sap.dbtech.jdbc.exceptions.DatabaseException: [-4005] (at 16): Unknown column name:ID
at com.sap.dbtech.jdbc.packet.ReplyPacket.createException(ReplyPacket.java:71)
at com.sap.dbtech.jdbc.ConnectionSapDB.throwSQLError(ConnectionSapDB.java:796)
at com.sap.dbtech.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:461)
at com.sap.dbtech.jdbc.CallableStatementSapDB.sendCommand(CallableStatementSapDB.java:1611)
at com.sap.dbtech.jdbc.StatementSapDB.sendSQL(StatementSapDB.java:725)
at com.sap.dbtech.jdbc.CallableStatementSapDB.doParse(CallableStatementSapDB.java:228)
at com.sap.dbtech.jdbc.CallableStatementSapDB.constructor(CallableStatementSapDB.java:179)
at com.sap.dbtech.jdbc.CallableStatementSapDB.<init>(CallableStatementSapDB.java:81)
at com.sap.dbtech.jdbc.ConnectionSapDB.prepareStatement(ConnectionSapDB.java:688)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:249)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:223)
at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:65)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:704)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:185)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:836)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:856)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:419)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2106)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1980)
at net.sf.hibernate.impl.SessionImpl.load(SessionImpl.java:1909)
at com.ejb.falaserio.hibernate.test.TestUsers.testUsers(TestUsers.java:56)
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 junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:410)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:294)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:182)
SQL Error: -4005, SQLState: 42000
[-4005] (at 16): Unknown column name:ID
SQL Exception
com.sap.dbtech.jdbc.exceptions.DatabaseException: [-4005] (at 16): Unknown column name:ID
at com.sap.dbtech.jdbc.packet.ReplyPacket.createException(ReplyPacket.java:71)
at com.sap.dbtech.jdbc.ConnectionSapDB.throwSQLError(ConnectionSapDB.java:796)
at com.sap.dbtech.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:461)
at com.sap.dbtech.jdbc.CallableStatementSapDB.sendCommand(CallableStatementSapDB.java:1611)
at com.sap.dbtech.jdbc.StatementSapDB.sendSQL(StatementSapDB.java:725)
at com.sap.dbtech.jdbc.CallableStatementSapDB.doParse(CallableStatementSapDB.java:228)
at com.sap.dbtech.jdbc.CallableStatementSapDB.constructor(CallableStatementSapDB.java:179)
at com.sap.dbtech.jdbc.CallableStatementSapDB.<init>(CallableStatementSapDB.java:81)
at com.sap.dbtech.jdbc.ConnectionSapDB.prepareStatement(ConnectionSapDB.java:688)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:249)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:223)
at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:65)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:704)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:185)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:836)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:856)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:419)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2106)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1980)
at net.sf.hibernate.impl.SessionImpl.load(SessionImpl.java:1909)
at com.ejb.falaserio.hibernate.test.TestUsers.testUsers(TestUsers.java:56)
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 junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:410)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:294)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:182)
SQL Error: -4005, SQLState: 42000
[-4005] (at 16): Unknown column name:ID
could not load: [com.ejm.falaserio.hibernate.Users#1]
com.sap.dbtech.jdbc.exceptions.DatabaseException: [-4005] (at 16): Unknown column name:ID
at com.sap.dbtech.jdbc.packet.ReplyPacket.createException(ReplyPacket.java:71)
at com.sap.dbtech.jdbc.ConnectionSapDB.throwSQLError(ConnectionSapDB.java:796)
at com.sap.dbtech.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:461)
at com.sap.dbtech.jdbc.CallableStatementSapDB.sendCommand(CallableStatementSapDB.java:1611)
at com.sap.dbtech.jdbc.StatementSapDB.sendSQL(StatementSapDB.java:725)
at com.sap.dbtech.jdbc.CallableStatementSapDB.doParse(CallableStatementSapDB.java:228)
at com.sap.dbtech.jdbc.CallableStatementSapDB.constructor(CallableStatementSapDB.java:179)
at com.sap.dbtech.jdbc.CallableStatementSapDB.<init>(CallableStatementSapDB.java:81)
at com.sap.dbtech.jdbc.ConnectionSapDB.prepareStatement(ConnectionSapDB.java:688)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:249)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:223)
at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:65)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:704)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:185)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:836)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:856)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:419)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2106)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1980)
at net.sf.hibernate.impl.SessionImpl.load(SessionImpl.java:1909)
at com.ejb.falaserio.hibernate.test.TestUsers.testUsers(TestUsers.java:56)
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 junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:410)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:294)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:182)

This error occurs with SAPDBDialect and I have tried with Oracle dialect but it also does not work.

I've tried to map the names with uppercase and lowercase and it also does not work.

The weird thing is when I copy the SQL generated on this output to SQLStudio it works perfectly.

Well I am in a hell here...I appreciate some help.

Thanks in advance,

Ernani

_________________
Best Regards,
Ernani Joppert Pontes Martins


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 13, 2004 12:21 am 
Beginner
Beginner

Joined: Fri Feb 06, 2004 6:59 am
Posts: 36
Location: S
Hi folks, the problem was not with hibernate, but with maxdb weird user definitions.

The problem was that the user that I was using to connect had only standard privileges and not a resource privilege.

By the way the user I was using in SQL Studio was a DBA user, that's why the query was executing allright.

Now It works really great.


Regards,

Ernani

_________________
Best Regards,
Ernani Joppert Pontes Martins


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.