Author: denis.forveille
Date: 2009-07-31 22:31:37 -0400 (Fri, 31 Jul 2009)
New Revision: 11331
Modified:
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/ManagedPersistenceContext.java
Log:
JBSEAM-4332
Handle exceptions when HTTP session expire and Seam cleanup EntityManagers in WebSphere
Modified:
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/ManagedPersistenceContext.java
===================================================================
---
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/ManagedPersistenceContext.java 2009-07-31
21:25:01 UTC (rev 11330)
+++
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/ManagedPersistenceContext.java 2009-08-01
02:31:37 UTC (rev 11331)
@@ -200,13 +200,24 @@
private void close()
{
boolean transactionActive = false;
+
try
{
- transactionActive = Transaction.instance().isActive();
+ UserTransaction tx = Transaction.instance();
+ try
+ {
+ transactionActive = tx.isActive();
+ }
+ catch (SystemException se)
+ {
+ log.debug("could not get transaction status while destroying persistence
context");
+ }
}
- catch (SystemException se)
+ catch (Exception e)
{
- log.debug("could not get transaction status while destroying persistence
context");
+ // WebSphere throws a javax.naming.ConfigurationException when
Transaction.instance() is called during HTTP Session expiration
+ // and there is no JNDI lookup possible. See details there: JBSEAM-4332
+ log.warn("could not get transaction while destroying persistence context.
(called during session expiration ?)");
}
if ( transactionActive )