[jboss-cvs] jboss-seam/src/main/org/jboss/seam/interceptors ...
Gavin King
gavin.king at jboss.com
Tue Nov 28 16:29:21 EST 2006
User: gavin
Date: 06/11/28 16:29:21
Modified: src/main/org/jboss/seam/interceptors
ManagedEntityIdentityInterceptor.java
Log:
JBSEAM-533
Revision Changes Path
1.13 +18 -2 jboss-seam/src/main/org/jboss/seam/interceptors/ManagedEntityIdentityInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ManagedEntityIdentityInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/interceptors/ManagedEntityIdentityInterceptor.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- ManagedEntityIdentityInterceptor.java 1 Nov 2006 02:54:02 -0000 1.12
+++ ManagedEntityIdentityInterceptor.java 28 Nov 2006 21:29:21 -0000 1.13
@@ -117,13 +117,29 @@
if (persistenceContext instanceof EntityManager)
{
EntityManager em = (EntityManager) persistenceContext;
+ try
+ {
managed = em.isOpen() && em.contains(value);
+ }
+ catch (RuntimeException re)
+ {
+ //workaround for bug in HEM! //TODO; deleteme
+ managed = false;
+ }
id = managed ? PersistenceProvider.instance().getId(value, em) : null;
}
else
{
Session session = (Session) persistenceContext;
+ try
+ {
managed = session.isOpen() && session.contains(value);
+ }
+ catch (RuntimeException re)
+ {
+ //just in case! //TODO; deleteme
+ managed = false;
+ }
id = managed ? session.getIdentifier(value) : null;
}
if (managed)
More information about the jboss-cvs-commits
mailing list