You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Tore Halset <ha...@pvv.ntnu.no> on 2006/06/09 15:53:49 UTC

loading another datadomain

Hello.

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?

  - Tore, multi-datadomain newbie.

Re: loading another datadomain

Posted by Andrus Adamchik <an...@objectstyle.org>.
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.
>


Re: loading another datadomain

Posted by Tore Halset <ha...@pvv.ntnu.no>.
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.

RE: loading another datadomain

Posted by "Gentry, Michael (Contractor)" <mi...@fanniemae.com>.
See if the first comment at:

http://www.objectstyle.org/confluence/display/CAY/3.0+Wish+List

Helps you ...


/dev/mrg

-----Original Message-----
From: Tore Halset [mailto:halset@pvv.ntnu.no] 
Sent: Friday, June 09, 2006 9:54 AM
To: cayenne-user@incubator.apache.org
Subject: loading another datadomain


Hello.

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?

  - Tore, multi-datadomain newbie.