db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lionel Pasquier <lpasqu...@omnikles.com>
Subject Re: change of base configuration at runtime
Date Tue, 24 May 2005 10:01:23 GMT
I know you posted something about it, but I was unable to retrieve the 
thread.

What I tried to do was also:

Configuration torqueconf = Torque.getConfiguration();
torqueconf.setProperty("torque.dsfactory.mydb.connection.url", 
newproperties.get("torque.dsfactory.mydb.connection.url"));
torqueconf.setProperty("torque.dsfactory.customer.connection.user", 
newproperties.get("torque.dsfactory.customer.connection.user"));
torqueconf.setProperty("torque.dsfactory.customer.connection.password", 
newproperties.get("torque.dsfactory.customer.connection.password"));
Torque.setConfiguration(torqueconf);
Torque.getInstance().shutdown(); // with or without
Torque.getInstance().init(ConfigurationConverter.getConfiguration(properties));

But this led me to the a Nullpointer (db = 
Torque.getDB(criteria.getDbName()) is null) if the shutdown is present, 
and to contacting the wrong DB is the shutdown is not present.

Could you re-post your solution?


Guy Galil wrote:

>It depends on the version of Torque you use.
>I posted a solution for Torque 3.02 a while ago, The idea is to get the
>Configuration object, change some
>settings and reconfigure Torque.
>It requires some digging into the Torque code but is doable.
>I can provide the 3.02 code if you want but I know those things changed
>since that version.
>On Mon, 2005-05-23 at 18:55 +0200, Lionel Pasquier wrote:
>  
>
>>Hello,
>>
>>I 've read a few threads on this mailing list about the problem of 
>>changing of database configuration using:
>>Torque.init(pathToConf);
>>Torque.shutdown();
>>Torque.init(newPathOfConf);
>>
>>Unfortunatly I still have the classic NullpointerException at any torque 
>>access after the 2nd init.
>>
>>Has anyone solved this problem and knows a workaround?
>>
>>Lionel
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
>>For additional commands, e-mail: torque-user-help@db.apache.org
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
>For additional commands, e-mail: torque-user-help@db.apache.org
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message