cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobias Schoessler <>
Subject Sharing DataObject Jar among web contexts
Date Mon, 15 Mar 2010 13:45:26 GMT

I have many web apps sharing the same cayenne/mapping objects. I want to
share my cayenne classes among these web apps.  I have packaged the classes
successfully in a jar together with the cayenne.xml using a jndi data source
and the Map xml file. I have put this jar in the shared lib level of tomcat.

Now every web app deployed can use the mapping files without any cayenne
reference in its local WEB-INF lib. Super!

I can obviously  even use

DataContext dataContext = ServletUtil.getSessionContext(session);

to bind the DataContext to the session.

I am a bit worried now - is it really this easy?

I have not configured a org.objectstyle.cayenne.conf.WebApplicationListener
in the web apps web.xml.

Is it only used for finding the cayenne.xml in the Web-INF scope? I have
packaged the cayenne.xml with the jar in the global scope of tomcat I
therefore would not need this discovery feature.

Or is this listener used to clean up the DataContexts attached to the web
apps session? Do I need this Listener? Will the DataContexts attached lto
the session via ServletUtil leak if I do not have the WebApplication
listener defined?

Is this setup save?

thanks a lot.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message