ERROR: Property "CWebApplication.db" is read only.

Hello, is it somehow possible to get rid off this error?

Every time I try to create a new connection (new parameters) I get this error.

I searched the forum etc. for such error. Concerning this, my 'Urlmanager is under ‘components’ like it should be.

Any suggestions?

Please somebody share your thoughts. I am on a deadline and this stops me off :)

If you have another db-connection setup in config already, you can do:


Yii::app()->setComponent('db', Yii::app()->db2);

Otherwise:




$db = Yii::createComponent(array(

   'class' => 'CDbConnection',

   // other config properties...

));


Yii::app()->setComponent('db', $db);