cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Bruegge <daniel.brue...@googlemail.com>
Subject Re: Working with DataContext after manipulating datasource
Date Wed, 11 Jan 2012 18:02:36 GMT
Oh. Good to know. But is there a way to change the server dynamically
when executing one statement?

On Wed, Jan 11, 2012 at 3:53 PM, Andrus Adamchik <andrus@objectstyle.org> wrote:
> Hi Daniel,
>
> Since DataSource is attached to the DataNode, which is one of the shared parts of Cayenne
stack, not only new DataContexts, but all the existing ones will pick it up the moment you
set it.
>
> Andrus
>
> On Jan 11, 2012, at 5:37 PM, Daniel Bruegge wrote:
>
>> Hi,
>>
>> I am trying to change dynamically the database server and connection
>> in the application code. I am using the PoolManager and
>> DataSource-setting like described in
>> https://cwiki.apache.org/CAY/setting-database-connection.html.
>>
>> What I was wondering:  if I change this connection things with the
>> code above, will the next created DataContext using the new server?
>> I am creating the context via
>>
>> DataContext.createDataContext();
>>
>> set to the new server?
>>
>> Thanks & regards
>>
>> Daniel
>>
>

Mime
View raw message