cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: Working with DataContext after manipulating datasource
Date Wed, 11 Jan 2012 14:53:29 GMT
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