Ok. I fully apologise that I was indeed a bit lazy and did not take  
the time to explain fully. I should know better. I feel shame...

Right. To reproduce. It's slightly different to me original situation,  
but I've tried to minimize the steps:

- Install the Sample App From 1.0 Release

- In the settings of the sample app activate the database
<setting name="use_database">true</setting> in settings.xml

-  Change settings in databases.xml to the correct location/user/pass  
of database:

<ae:configuration environment="development">
<databases default="pdo_mysql_main">
        <database name="pdo_mysql_main" class="AgaviPdoDatabase">
                <ae:parameter name="dsn">mysql:host=localhost;dbname=blog_dev</ 
ae:parameter>
                <ae:parameter name="username">USERNAME</ae:parameter>
                <ae:parameter name="password">PASSWORD</ae:parameter>
        </database>
</databases>
</ae:configuration>

- Add to LoginError view:

$vr = $this->container->getValidationManager()->getReport();
$us = $this->context->getUser();
$us->setAttribute('validationReport', $vr);

At this stage no exception is thrown when the Login Error page is  
viewed. However, if just above the above code I add:

$this->context->getDatabaseManager()->getDatabase()- 
 >getConnection('pdo_mysql_main');

Then there is an exception when the Login Error view is called.

I hope this explains things a bit better. This is a bit of a different  
situation, as the PDO object is not in a model. However, I am indeed  
not storing it anywhere. Not even in the local function, let alone in  
the validation report itself, and the exception still occurs.


On 1 Mar 2009, at 20:54, Felix Gilcher wrote:

>
>
> Sent from my iPhone
>
> On 01.03.2009, at 21:48, Michal Charemza <[email protected]>
> wrote:
>
>>
>> On 1 Mar 2009, at 20:12, Felix Gilcher wrote:
>>> I fail to see why you'd want to store the validation report.
>>> However, the reason for the error is that somewhere in the code, a
>>> reference to a pdo object is stored. It may be that you're using an
>>> AgaviSingletonModel which would be in the request or that a
>>> validator stores a reference to an object that has a reference to a
>>> PDO connection. Hard to say without a look at your code, a detailed
>>> descrition or a minimal example. If you think this is an agavi bug,
>>> please send us instructions of how to reproduce this behavior - does
>>> it happen with all validators, a specific one, maybe even a custom
>>> one. Which type of database connection are you using etc. If you can
>>> check out the sampleapp and modify it to show your error, that would
>>> probably the best thing you could do - short of writing a unit test.
>>
>> This isn't a detailed description by any means, but database-wise it
>> is just like the tutorial, but in one of the views I store the
>> validation report. The only PDO reference anywhere in the app is just
>> like it is in the tutorial: in the base class for the post model.
>
> That does not help me at all. I need a way to reproduce your error. So
> either you explain me how to reproduce it or you send me some sample.
> I'm not going to start some wild guessing, that's just a waste of  
> time.
>
> Cheers
>
> Felix
>
>>
>>
>> _______________________________________________
>> users mailing list
>> [email protected]
>> http://lists.agavi.org/mailman/listinfo/users
>>
>
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.agavi.org/mailman/listinfo/users


_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users

Reply via email to