Hibernate 3:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Oracle 10g:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
hi list,
i call method from my action struts class, i'm using tomcat 5.0.28:
Session session = HibernateSessionFactory.currentSession();
Transaction tx = session.beginTransaction();
session.save(myObject);
tx.commit();
session.close();
i insert my Object to DB successfully, but when i want to execute my forward in action struts i got the following displayed error on page, but
when i remove the line "session.close();" page is displayed successfully:
exception
javax.servlet.ServletException: Session is closed
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:523)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
...................
cause mère
org.hibernate.SessionException: Session is closed
org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:131)
org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:49)
org.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:24)
org.hibernate.jdbc.JDBCContext.beginTransaction(JDBCContext.java:271)
org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1079)
ma.co.omnidata.intranet.metier.service.referentiel.ServicesRefCommun.getBuList(ServicesRefCommun.java:47)
ma.co.omnidata.intranet.presentation.action.contrat.ContratInitAction.execute(ContratInitAction.java:41)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1062)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
thanks
_________________ (it's not doubt who makes us crazy, but the fact to be sure)
|