With default Yii implementation, PDO will throw exception saying there already is active transaction.
But there's a solution:)
First, you'll need to extend PDO class and save it in your the protected/components directory:
[...]
```
Then, you'll need to alter the behaviour of [CDbConnection::createPdoInstance()]. You can do this by making a subclass of it in protected/components/NestedDbConnection.php
There, change $pdoClass toNow your class name (NestedPDO in this example):
```php
class NestedDbConnection extends CDbConnection
return new $pdoClass($this->connectionString,$this->username,
$this->password,$this->attributes);
}
}
```
Note that $this->_attributes was also changed to $this->attributes so the subclassing will work.
Now you can add the class name to thean use it in db configuration array in `protected/config/main.php`:
```php
'db'=>array(
'c'pdoClass' => 'NestedDbConnection',
PDO',
'connectionString' => ...
),
```
That's it, there you go ;)