-->
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.  [ 4 posts ] 
Author Message
 Post subject: problem in save() update and delete() working fine
PostPosted: Tue Jan 18, 2005 1:35 am 
Newbie

Joined: Fri Nov 19, 2004 12:17 am
Posts: 5
when i am querying to the different table space in oracle.
the select query is working fine but in the save query i am getting message

table or view not found.

In this application i am using

hibernate.dialect net.sf.hibernate.dialect.OracleDialect
hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver
hibernate.connection.username oamadmin
hibernate.connection.password oamadmin
hibernate.connection.url jdbc:oracle:oci:@//qatestmachine:1521/ORCL
hibernate.show_sql true
hibernate.default_schema scott

oamadmin user have grant of DBA and scott is working on table space SYSTEM.

when i have select query it is making the call to the SYSTEM tablespace and working fine,but when i am sending the save query it is making call on the oamadmin's default tablespace.
update and delete is also working fine
what is the problem.

Regards
Ajay


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 18, 2005 7:06 am 
Newbie

Joined: Wed Aug 04, 2004 6:19 am
Posts: 9
Can you give us some more infos,
like mappings, and the generated sql statements?


Top
 Profile  
 
 Post subject: Mapping and Save file information
PostPosted: Wed Jan 19, 2005 1:32 am 
Newbie

Joined: Fri Nov 19, 2004 12:17 am
Posts: 5
hi
table is simple table which have only 3 fields. id,name,dob.
this is the save file for saving database.

protected ModelAndView onSubmit(Object command)
{
//Get the Object from request
Employee emp=(Employee)command;
try {
Session sess = null;
// DefaultTransactionStatus def= new DefaultTransactionStatus();

SessionFactory sf = trMgr.getSessionFactory();

//Open Session for database communication
sess = sf.openSession();
sess.save(emp);

}catch (HibernateException e) {

e.printStackTrace();
}

return new ModelAndView("index");
}

}


This is the mapping file
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping package="mobera.application.business">
<class name="Employee" table="TBL_EMP_PRO">
<id name="empid" type="integer" unsaved-value="null" >
<column name="emp_id" sql-type="int" not-null="false"/>
<generator class="increment"/>
</id>
<property name="empname">
<column name="emp_name" length="20" not-null="false"/>
</property>
<property name="empdob">
<column name="emp_dob" length="10" not-null="false"/>
</property>
</class>
</hibernate-mapping>

do u require any more information.

Thanks and regards
Ajay


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 19, 2005 4:04 am 
Newbie

Joined: Wed Aug 04, 2004 6:19 am
Posts: 9
Can you show us the sql statements, which have been generated by
hibernate,

And you can try to execute these sql statements manually.

yours,
pgrau


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