I have issue on random session close on my hibernate ejb:
Code:
public OrderHandler() throws NamingException {
logger.debug("Enter c'tor of OrderHandler()");
InitialContext ctx = new InitialContext();
SessionFactory sessionFac_report = new Configuration().configure().buildSessionFactory();
sesReporting = sessionFac_report.openSession();
}
...
public void saveToDatabase() throws Exception {
Transaction txReporting = null;
try{
txReporting =sesReporting.beginTransaction();
...
}catch (Exception e) {
if (txReporting != null) {
// Something went wrong; discard all partial changes
txReporting.rollback();
}
throw e;
}
}
it runs fine with small msg size (translate from a file 50 kb), and keep getting the session is closed when it reaches large msg size(translate from a file 2 Mb) with this:
Code:
2008-09-18 18:23:20,854 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_58] - Abort of action id accef56:5bf:48d22593:422 invoked while multiple threads active within it.
2008-09-18 18:23:20,854 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.CheckedAction_2] - CheckedAction::check - atomic action accef56:5bf:48d22593:422 aborting with 1 threads active!
2008-09-18 18:23:23,260 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_58] - Abort of action id accef56:5bf:48d22593:430 invoked while multiple threads active within it.
2008-09-18 18:23:23,260 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.CheckedAction_2] - CheckedAction::check - atomic action accef56:5bf:48d22593:430 aborting with 1 threads active!
2008-09-18 18:23:42,338 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_58] - Abort of action id accef56:5bf:48d22593:445 invoked while multiple threads active within it.
2008-09-18 18:23:42,338 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.CheckedAction_2] - CheckedAction::check - atomic action accef56:5bf:48d22593:445 aborting with 1 threads active!
2008-09-18 18:23:53,870 INFO [txn.class com.flextronics.fftester.OrderHandler] 1066869,DEBF101,Administrator,10068927,Session is closed!,Thu Sep 18 18:23:53 SGT 2008
2008-09-18 18:23:53,885 ERROR [STDERR] org.hibernate.SessionException: Session is closed!
at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:49)
at org.hibernate.impl.SessionImpl.getActionQueue(SessionImpl.java:1817)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:201)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
...
I found other ppl have similar issue:
http://forum.hibernate.org/viewtopic.php?p=2335158
http://forum.hibernate.org/viewtopic.php?p=2373543
and also this:
Quote:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html
what's the best way to handles it?