-->
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: ORA-02289 sequence does not exist
PostPosted: Wed Nov 07, 2012 2:23 am 
Newbie

Joined: Wed Nov 07, 2012 2:14 am
Posts: 1
Hi,

While developing a web application using spring and hibernate i am getting the following execption.

java.sql.SQLException: ORA-02289: sequence does not exist

While i am trying to insert the data into a table i am usign sequence to increment the value of request_id.


I am using the following coding for inserting



public class HibernateConfig
{
public static SessionFactory sessionFactory;
public static SessionFactory getSessionFactory()
{
sessionFactory = new Configuration().configure().buildSessionFactory();
return sessionFactory;
}
}
@Override
public void postRequest(RequestInfo requestInfo)
{
Session session = null;
Transaction trans = null;
SessionFactory sessionFactory = null;

sessionFactory=HibernateConfig.getSessionFactory();
session= sessionFactory.openSession();
trans = session.beginTransaction();
session.save(requestInfo);
trans.commit();
session.close();

}


In hibernate mapping i have mentioned like this

<id name="requestId" type="int" column="request_id" >
<generator class="sequence">
<param name="sequence">REQUEST_INFO_SEQ</param>
</generator>
</id>


i am using oracle 11g.

Can any one give me solution for this.


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.