-->
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: system throws SessionException when update
PostPosted: Fri Oct 14, 2005 4:00 am 
Newbie

Joined: Fri Oct 14, 2005 3:42 am
Posts: 1
My update code as follow :

Session session = HibernateUtil.currentSession();
try {
HibernateUtil.beginTransaction();
session.saveOrUpdate(pojo);
HibernateUtil.commitTransaction();
} catch (HibernateException e) {
throw new InfrastructureException(e);
} finally {
HibernateUtil.closeSession();
}

when I update pojo, system throws :
org.hibernate.SessionException: Session is closed
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:131)
at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:119)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:95)
at com.muyi.hibernate.session.HibernateUtil.commitTransaction(HibernateUtil.java:120)
at com.muyi.hibernate.dao.AbstractDao.update(AbstractDao.java:60)
......

I have confirmed that my logic has no problems , so I don't understand what's problems cause that. Are there anyone had met this problem ??

oh God, help me......


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 14, 2005 4:51 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
http://hibernate.org/42.html
http://hibernate.org/43.html


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.