-
1. Re: Multi Managed Persistence Context Problem
gavin.king Nov 28, 2006 4:08 PM (in response to cavani)Yes, it is a bug.
http://jira.jboss.com/jira/browse/JBSEAM-533
But actually it looks like the bug is in HEM, not in Seam (I assume you are using Hibernate):
http://java.sun.com/javaee/5/docs/api/javax/persistence/EntityManager.html#contains(java.lang.Object)
So why not report this in Hibernate JIRA, and I will put a temporary workaround in Seam. -
2. Re: Multi Managed Persistence Context Problem
cavani Nov 28, 2006 8:56 PM (in response to cavani)Thanks again! it works!
And, yes! I am using JBoss 4.0.5/EJB3 R9 (Hibernate on base).
I am not conviced that this is HEM bug. By specs, an entity bean may be any POJO (including XML-only mapped one) that can be associated with a certain Persistence Unit. This way, "contains" should not evaluate any Object (instance) that is not in it own configuration (mapping).
Of cource, annotated pojos is very simple to test for entity nature but there is many other ways to define that it is an entity on any other persistence unit.
I think this is a lake of good statement of spec. I think the exception should be "IllegalArgumentException - if not an entity for this persistence unit" or something like that.
Do you think this is resoneable?