|
From my mail to dev list:
--------------------------------------------------
...
It's about "placeful service" and packages that want to contribute
@Entity beans to that service.
Currently we already have "notification service" contributing bean to
placeful service, which is done in deployment-fragment.xml of
notification service:
...
<extension target="persistence#CLASS">
<class>org.nuxeo.ecm.platform.ec.notification.UserSubscription</class>
</extension>
...
Above will become part of persistence.xml file inside
nxplacefulservice-facade.jar directory in nuxeo.ear on jboss startup:
<persistence>
<persistence-unit name="nxplacefulservice">
<jta-data-source>java:/DefaultDS</jta-data-source>
<class>
org.nuxeo.ecm.platform.ec.notification.UserSubscription
</class>
<properties>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="jboss.entity.manager.jndi.name"
value="java:/nxplacefulservice"/>
</properties>
</persistence-unit>
</persistence>
So far so good.
But the problem is that on jboss startup Hibernate persistence provider
will do scan of jars to find @Entity beans defined in persistence.xml
file and in our case if notification service is not yet deployed
provider fails to find that @Entity bean.
This leads to the fact that we need explicitely modify
nxplacefulservice-facade's deployment-fragment.xml to include required
jar containing @Entity bean(s) so that it is deployed before Hibernate
analyzes persitence.xml file in placeful service:
...
<require>nxnotificationservice.jar</require>
...
which sucks, but actually does its job.
The implications are that at the moment every package contributing
@Entity beans to placeful service will need also to modify placeful
service's deployment-fragment.xml to include itself as required to allow
Hibernate provider to find @Entity beans.
|
|
|
|
|
|
_______________________________________________
ECM-tickets mailing list
ECM-tickets@lists.nuxeo.com
http://lists.nuxeo.com/mailman/listinfo/ecm-tickets