change DataNode

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

change DataNode

Jacek Sałacki
Im developing an application that should use one of 3 databases, depending on
situation. Each database use the same map and tables set but differ in
conection method(one is avaliable in internet, other only in internal
network, one is avalaible on local computer). I want to give users  
opportunity to chose to which database connect.
If I understood everything right, I could use 3 DataNodes in one DataDomain.
How tell cayenne which one of datanodes use?

--
Jacek Sa?acki
Reply | Threaded
Open this post in threaded view
|

RE: change DataNode

Gentry, Michael (Contractor)
If you need simultaneous access, this will do the trick (at least it works for me):

http://www.objectstyle.org/confluence/display/CAY/Copying+DataMaps

If you only need to access one (and only one) at a time, given a certain condition, there was a thread on that (I believe by Kevin, but I'd have to go find it) which will also work.  Let me know if you need that one.

/dev/mrg


-----Original Message-----
From: Jacek Salacki [mailto:[hidden email]]
Sent: Wednesday, August 31, 2005 11:54 AM
To: [hidden email]
Subject: change DataNode


Im developing an application that should use one of 3 databases, depending on
situation. Each database use the same map and tables set but differ in
conection method(one is avaliable in internet, other only in internal
network, one is avalaible on local computer). I want to give users  
opportunity to chose to which database connect.
If I understood everything right, I could use 3 DataNodes in one DataDomain.
How tell cayenne which one of datanodes use?

--
Jacek Sałacki
Reply | Threaded
Open this post in threaded view
|

Re: change DataNode

Jacek Sałacki
Dnia ?roda 31 sierpie? 2005 05:58 pm, Gentry, Michael (Contractor) napisa?:
> If you need simultaneous access, this will do the trick (at least it works
> for me):
>
> http://www.objectstyle.org/confluence/display/CAY/Copying+DataMaps
>
> If you only need to access one (and only one) at a time, given a certain
> condition, there was a thread on that (I believe by Kevin, but I'd have to
> go find it) which will also work.  Let me know if you need that one.
>

One and only one database at a time. Users should choose which database use at
application start.
Mayby you remember the topic of that thread you have mentioned?

--
Jacek Sa?acki
Reply | Threaded
Open this post in threaded view
|

Re: change DataNode

Andrus Adamchik
Oh, so this is not a multiuser application? Then it is easier to swap  
a DataSource of an existing DataNode:

http://objectstyle.org/confluence/display/CAY/Setting+Database 
+Connection

In Swing applications I personally like a custom DataSourceFactory  
solution briefly mentioned in the Wiki article above, that pops a  
login panel.

Andrus


On Aug 31, 2005, at 12:09 PM, Jacek Sałacki wrote:

> Dnia środa 31 sierpień 2005 05:58 pm, Gentry, Michael (Contractor)  
> napisał:
>
>> If you need simultaneous access, this will do the trick (at least  
>> it works
>> for me):
>>
>> http://www.objectstyle.org/confluence/display/CAY/Copying+DataMaps
>>
>> If you only need to access one (and only one) at a time, given a  
>> certain
>> condition, there was a thread on that (I believe by Kevin, but I'd  
>> have to
>> go find it) which will also work.  Let me know if you need that one.
>>
>>
>
> One and only one database at a time. Users should choose which  
> database use at
> application start.
> Mayby you remember the topic of that thread you have mentioned?
>
> --
> Jacek Sałacki