[Catalyst] Weird -d flag and txn_do interaction...
Marcello Romani
mromani at ottotecnica.com
Mon Sep 10 08:06:07 GMT 2007
Matt S Trout ha scritto:
> On Mon, Aug 27, 2007 at 05:10:23PM +0200, Marcello Romani wrote:
>> Hi,
>> I'm developing an app using cat and dbic, with postgresql 8.1.
>> I've got a table with a "unique" column.
>>
>> When I try to insert a record that violates that constraint (the code is
>> executed via txn_do($coderef)), I obviously get an exception from DBIC.
>>
>> The problem is that if I run myapp_server without the -d flag, the
>> exception string is correct; but if I run it _with_ the -d flag istead,
>> the error gets cleared by a SELECT(*) COUNT executed with apparently no
>> reason after the failing INSERT() query.
>> Therefore the error string I get is something like "command ignored
>> until end of transaction block."
>
> Something's numifying the $rs thus causing ->count to be called.
>
Thanks for the tip.
I suspect is't something out of my control, otherwise the problem would
show up also when I'm not using the -d flag, right ?
I'd like to track this problem down, but I think I'll have to dive into
the internals of cat and/or dbic... which I'm not familiar with.
Do you have any other suggestion for where to start looking for
differences in behaviour between -d and normal run ?
Thank you again.
--
Marcello Romani
Responsabile IT
Ottotecnica s.r.l.
http://www.ottotecnica.com
More information about the Catalyst
mailing list