-->
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: Hibernate does not work after Oracle is restarted
PostPosted: Wed Jan 02, 2008 12:23 pm 
Newbie

Joined: Thu Mar 08, 2007 10:44 pm
Posts: 5
Hibernate version: 3.2.5

Code between sessionFactory.openSession() and session.close():
List result;
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
Query q = session
.createQuery("from ApplGrpPrvVu agp where " +
"agp.id.appl.applGn=:applGn and " +
"agp.id.grp.grpGn=:grpGn");
q.setBigDecimal("applGn", appl.getApplGn());
q.setString("grpGn", grp.getGrpGn());
result = q.list();
session.getTransaction().commit();


Full stack trace of any exception that occurs:
10:26:56,360 WARN JDBCExceptionReporter:77 - SQL Error: 17002, SQLState: null
10:26:56,370 ERROR JDBCExceptionReporter:78 - 10:26:56,401 ERROR ApplicationImpl:289 - Managedbean HomeUserAdmin could not be created Can't instantiate class: 'com.ebmud.admin.jsf.HomeUserAdmin'.. class com
.ebmud.admin.jsf.HomeUserAdmin : org.hibernate.exception.GenericJDBCException: c
ould not execute query
javax.faces.FacesException: Can't instantiate class: 'com.ebmud.admin.jsf.HomeUs
erAdmin'.. class com.ebmud.admin.jsf.HomeUserAdmin : org.hibernate.exception.Gen
ericJDBCException: could not execute query
at com.sun.faces.config.ManagedBeanFactory.newInstance(ManagedBeanFactor
y.java:229)
at com.sun.faces.application.ApplicationAssociate.createAndMaybeStoreMan


Name and version of the database you are using: Oracle 10g

My company shuts down the Oracle server every midnight for an hour. This seems to break my hibernate implementation. It looks like hibernate sees a "Io exception: End of TNS data channel" and does not try to reestablish that channel. Does anyone have any tips on how I can handle this situation?

Thanks,

Marc


Top
 Profile  
 
 Post subject: Re: Hibernate does not work after Oracle is restarted
PostPosted: Thu Jan 20, 2011 4:57 am 
Newbie

Joined: Mon Sep 01, 2008 1:58 am
Posts: 3
the session is already closed once the DB server is restarted

try to use openSession() instead of getCurrentSession()


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.