Michael Mogley wrote:
hmm, I suppose it should be possible (e.g. it's possible to deploy OJB within ejb's and share these beans across webapps). But does it make sense? If you want to change one app, you have to shutdown/restart Tomcat because you share OJB resources.You're probably right. But is there no way then to keep Ojb as a shared library?
>>>OK, I've got two Tomcat webapps. Each with it's own >>>OJB.properties and repository xml files
if you want to share OJB, then you can't use different OJB.properties and repository files.
If you want discrete configurations for each webapp, then you need different ClassLoader for each webapp, thus you have to put OJB libraries in your web-inf directory (as Charles describe).
If you want to share OJB, then put all OJB jars under tomcat shared ClassLoader (I think $CATALINA_HOME/lib). Use one configuration for all webapps. For each database define a connection-descriptor and use a jcdAlias name. Lookup PB instances using the defined jcdAlias names.
regards, Armin
Michael
----- Original Message ----- From: "Charles Anthony" <[EMAIL PROTECTED]>
To: "'OJB Users List'" <[EMAIL PROTECTED]>
Sent: Monday, December 08, 2003 11:23 PM
Subject: RE: ojb mixing up jdbc-connection-descriptors
I think you'll find that putting OJB in /common/lib is your problem.
Try putting the the OJB jars in the each webapps WEB-INF/lib directory,
and
see if the problem goes away. I think it will.
Cheers,
Charles.
-----Original Message----- From: Michael Mogley [mailto:[EMAIL PROTECTED] Sent: 09 December 2003 07:29 To: OJB Users List Subject: ojb mixing up jdbc-connection-descriptors
OK, I've got two Tomcat webapps. Each with it's own OJB.properties and repository xml files defining two different mappings and two different connection descriptors.
Ojb libraries are in common/lib to allow sharing among webapps.
Everything was working file until I added the second webapp.
Now, observing the logs, it seems the first webapp is getting the broker corresponding to the connection-descriptor in the second one. In both apps, I do PersistenceBroker.defaultBrokerInstance() to obtain the brokers. I tried giving each connection-descriptor a unique jcd-alias, but to no avail. Actually, that's how I discovered what the problem is.
How do I tell Ojb to reference the connection-descriptor defined for a specific webapp? This seems like a classloading issue. Perhaps, there is a place in the Ojb code without a needed Thread.getContextClassLoader() call?
Please help. I'm running out of time debugging Ojb issues.
Michael
___________________________________________________________ HPD Software Ltd. - Helping Business Finance Business Email terms and conditions: www.hpdsoftware.com/disclaimer
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
