-->
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.  [ 3 posts ] 
Author Message
 Post subject: Hibernate 3.0 saveorupdate api throws table not found error
PostPosted: Wed Feb 06, 2008 5:19 am 
Newbie

Joined: Mon Feb 04, 2008 8:20 am
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.0
DB: Sybase 10
Mapping documents:
<hibernate-mapping default-lazy="false">
<class name="TestClass" table="TestTable" schema="DBA">
<id name="ID" type="long" unsaved-value="0">
<column name="ID" not-null="true"/>
<generator class="identity"/>
</id>

Tables are owned by DBA
The user which the application(running on weblogic) uses to connect to DB is a non-admin user say 'testuser'.
testuser has the privileges to 'insert,update,delete and select' on the tables

Problem:
The insertion of data into the table works fine,but when ever application is trying to update the data in the table it throws the following error.
Session.saveorupdate(object)

Caused by: org.hibernate.exception.SQLGrammarException: could not update: [TestClass#409472]
Caused by: java.sql.SQLException: [Sybase][ODBC Driver][Adaptive Server Anywhere]Table 'TestTable' not found

Any help in this regard is appreciated


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 06, 2008 4:26 pm 
Red Hat Associate
Red Hat Associate

Joined: Mon Aug 16, 2004 11:14 am
Posts: 253
Location: Raleigh, NC
1. Capture the exact SQL logged by org.hibernate.SQL (fill in bind params as necessary)
2. Login with the same db user directly to the database.
3. Execute the SQL

This will tell you what's going on, hopefully.

_________________
Chris Bredesen
Senior Software Maintenance Engineer, JBoss


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 08, 2008 8:27 am 
Newbie

Joined: Mon Feb 04, 2008 8:20 am
Posts: 2
I printed the query generated by Hibernate for update and found that it is not prefixing the schema name to the table name when it is trying the update the data.

But, i have specified 'schema=DBA' in the hbm file.

Any pointers on missing link would help


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.