tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fred59 <frederic.fouc...@atosorigin.com>
Subject Re: Overriding persistence-unit-name
Date Tue, 12 May 2009 10:03:57 GMT

ok thanks for reply.

But it seems that in my test, I call the session bean with the
xastory-csm-core.net.atos.xastory.csm.core.product.CatalogueManager name so
if I understand the test should not work.

We use our own implementation to call different resource registered in JNDI.
This implementation is based on a configuration file containing the resource
with its binding name. In this file, the CatalogueManager is defined like
the following :

net.atos.xastory.csm.core.product.CatalogueManager=openejb\:xastory-csm-core.net.atos.xastory.csm.core.product.CatalogueManager

I don't understand why the test is working ?




Jean-Louis MONTEIRO wrote:
> 
> Hi,
> 
> you're definitely right.
> 
> An EJB (CatalogueManager) in an ejb-jar (project A) is deployed and bound
> to JNDI.
> 
> 
> Fred59 wrote:
>> 
>> <ejb-jar>
>> 	<enterprise-beans>
>> 		<session>
>> 			<ejb-name>projectBCatalogueManager</ejb-name>
>> 		
>> <ejb-class>net.atos.xastory.csm.core.product.impl.CatalogueManagerImpl</ejb-class>
>> 			<persistence-context-ref>
>> 				<persistence-context-ref-name>
>> 					net.atos.xastory.csm.core.product.impl.CatalogueManagerImpl/em
>> 				</persistence-context-ref-name>
>> 				<persistence-unit-name>
>> 					cmi-csm-core
>> 				</persistence-unit-name>
>> 			</persistence-context-ref>
>> 		</session>
>> 	</enterprise-beans>
>> </ejb-jar>
>> 
> 
> Such configuration allows you to define a new EJB named
> projectBCatalogueManager in project B (different ejb-jar) based on the
> same class.
> 
> So you will get 2 beans:
> - the original from the ejb-jar named A with one persistence context
> - another one from the ejb-jar named B with the overridden persistence
> context
> 
> So, depending on your needs, you can use one or the other.
> 
> Jean-Louis
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Overriding-persistence-unit-name-tp23498287p23499687.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Mime
View raw message