Issue (View Online)

Key: NXP-812
Issue Type: Improvement Improvement
Status: Open Open
Priority: Minor Minor
Assignee: Bogdan Stefanescu
Reporter: Ruslan Spivak

Operations

View all
View comments
View history
deployment order mechanism + hibernate persistence provider 
Updated: 31/03/07 17:15   Created: 31/03/07 17:14  

The following comment has been added to this issue: [ Permlink ]

Author: Ruslan Spivak
Date: 31/03/07 17:15
Comment:
Bogdan's comment:
------------------------------------

A possible approach to solve this type of problems would be to modify
the deployment order logic and instead of using "require" tags to
control the order
we could use "after" and/or "before" tags

Project: Nuxeo Enterprise Platform 5
Components: Runtime

 Description   
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.

This message was automatically generated by Atlassian JIRA Enterprise Edition, Version: 3.7.2-186 - Bug/feature request.
If you think it was sent incorrectly, contact one of this server's administrators.

_______________________________________________
ECM-tickets mailing list
ECM-tickets@lists.nuxeo.com
http://lists.nuxeo.com/mailman/listinfo/ecm-tickets

Reply via email to