|
|
Re: EclipseLink persistance.xml Tomcat OSGI [message #496619 is a reply to message #494427] |
Tue, 10 November 2009 16:59 |
Thomas Haskes Messages: 147 Registered: July 2009 |
Senior Member |
|
|
Hi Ashish,
maybe it is a solution for you you not to use the persistence.xml at
all, as it can be overriden by the use of properties when creating the
emf. This would enable you to retreive the properties form outside the
bundle and put them into the emf. That way you could provide the
settings in a file outside the bundle jar. Im thinking of something like
this:
// retrive the the properties-file from somwhere and load it
.....
// hand it over to the emf, which will override the settings in the
persistence.xml
Properties props = loadFromExternalFile();
Persistence.createEntityManagerFactory("yourpu", props);
I think most of the configs can be overriden using the
PersistenceUnitProperties:
Example:
props.put("PersistenceUnitProperties.JDBC_USER", "User");
.... and so on.
HTH
Tom
Ashish schrieb:
> Hello,
> I am working on project which uses EclipseLink and OSGi on Tomcat
> server. If I put persistence.xml in EclipseLink bundle
> (META-INF\persistence.xml) and deploy it in tomcat with bridge.war, it
> works very fine.
>
> But I want to take out persistence.xml out of bundle jar and put that
> somewhere in Tomcat environment so that DB can be configured without
> changing the bundle jar.
>
> My question is: Can I put META-INF\persistence.xml in tomcat environment
> where EclipseLink bundle is in bridge\WEB-INF\eclipse\plugin? If yes,
> please suggest me, where should I put it.
>
> Thank you very much in advance.
>
> Ashish
|
|
|
Powered by
FUDForum. Page generated in 0.03055 seconds