Yeah, you would want to have both maps in a single DD (otherwise you'll have to maintain two DataContexts for the same user). If cdeploy Ant task is too cumbersome to use (i.e. you want runtime detection), you can load a second map via the API.

The easiest way to do this is using the trick Michael referred to - rename the second cayenne.xml to something else, then load it in a separate temporary Configuration instance [new DefaultConfiguration ("my-cayenne.xml")]), and then grab a DataNode from that separate stack and attach it to the main stack (DataDomain.addNode(..)).

Andrus



On Jun 9, 2006, at 6:01 PM, Tore Halset wrote:

On Jun 9, 2006, at 15:53, Tore Halset wrote:

My web application has a single DataDomain. This application are sometimes deployed with a second application (as a boundled jar- file in the same classloader) that I am porting over to cayenne. As the first application has to work without the second app loaded, my main cayenne.xml has only the first domain and map-file.

During startup of the main application, I want to load the second domain and map if it is pressent. Is that possible? How?

If it is easier, I guess using a single DataDomain for both of the DataMaps should be possible. Each of the DataMaps will have a separate DataNode. I still wonder how those can be loaded if present.

 - Tore.


Reply via email to