[Catalyst] Weird -d flag and txn_do interaction...

Marcello Romani mromani at ottotecnica.com
Fri Sep 14 07:39:51 GMT 2007


Matt S Trout ha scritto:
> On Mon, Sep 10, 2007 at 09:06:07AM +0200, Marcello Romani wrote:
>> 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.
> 
> It may be when the debugger displays the rs.
> 
> I'm not really sure, I don't ever use the perl debugger - I'm a "you can
> have printf/warn when you pry it from my cold, dead fingers" sort of dev :)
> 

LOL

Thanks

-- 
Marcello Romani
Responsabile IT
Ottotecnica s.r.l.
http://www.ottotecnica.com



More information about the Catalyst mailing list