Re: [Catalyst] Weird -d flag and txn_do interaction...
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 ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Weird -d flag and txn_do interaction...
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 :) -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical DirectorWant a managed development or deployment platform? Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote http://chainsawblues.vox.com/http://www.shadowcat.co.uk/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Weird -d flag and txn_do interaction...
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. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical DirectorWant a managed development or deployment platform? Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote http://chainsawblues.vox.com/http://www.shadowcat.co.uk/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Weird -d flag and txn_do interaction...
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. The connection options include AutoCommit=1. The two attachments include the log output of myapp_server.pl for exactly the same http POST request, with and without the -d flag respectively. Thanks in advance for any help. -- Marcello Romani Responsabile IT Ottotecnica s.r.l. http://www.ottotecnica.com [EMAIL PROTECTED] ~/perl/LettereAttivazione $ DBI_TRACE=1 perl -Mlib=lib script/lettereattivazione_server.pl DBI 1.58-nothread default trace level set to 0x0/1 (pid 7375) at DBI.pm line 271 via DBI.pm line 8 You can connect to your server at http://serverlinux:3000 - DBI-connect(dbi:Pg:database=LettereAttivazione, la, , HASH(0x90767ec)) - DBI-install_driver(Pg) for linux perl=5.008008 pid=7375 ruid=1010 euid=1010 install_driver: DBD::Pg version 1.49 loaded from /usr/lib/perl5/site_perl/5.8.8/i686-linux/DBD/Pg.pm - install_driver= DBI::dr=HASH(0x907e870) !! warn: 0 CLEARED by call to connect method - connect('database=LettereAttivazione' 'la' ...)= DBI::db=HASH(0x90e9cf0) at DBI.pm line 633 - STORE('RaiseError' 1)= 1 at DBI.pm line 685 - STORE('PrintError' 1)= 1 at DBI.pm line 685 - STORE('AutoCommit' 1)= 1 at DBI.pm line 685 - STORE('Username' 'la')= 1 at DBI.pm line 688 FETCH('Username')= 'la' ('Username' from cache) at DBI.pm line 688 - connected('dbi:Pg:database=LettereAttivazione' 'la' ...)= undef at DBI.pm line 694 - connect= DBI::db=HASH(0x90e9cf0) - STORE('dbi_connect_closure' CODE(0x90e9864))= 1 at DBI.pm line 703 - STORE('HandleError' CODE(0x90e9f00))= 1 at DBI.pm line 782 - STORE('ShowErrorStatement' 1)= 1 at DBI.pm line 783 - STORE('RaiseError' 1)= 1 at DBI.pm line 784 - STORE('PrintError' 0)= 1 at DBI.pm line 785 - FETCH('AutoCommit')= 1 at Grouped.pm line 270 - FETCH('Driver')= DBI::dr=HASH(0x907e870) at DBI.pm line 738 FETCH('Name')= 'Pg' ('Name' from cache) at DBI.pm line 738 - FETCH('Active')= 1 at DBI.pm line 673 - ping= 1 at DBI.pm line 673 - FETCH('Active')= 1 at DBI.pm line 673 - ping= 1 at DBI.pm line 673 - begin_work= 1 at DBI.pm line 809 - FETCH('Active')= 1 at DBI.pm line 673 - ping= 1 at DBI.pm line 673 - FETCH('Driver')= DBI::dr=HASH(0x907e870) at DBI.pm line 66 FETCH('Name')= 'Pg' ('Name' from cache) at DBI.pm line 66 - FETCH('Driver')= DBI::dr=HASH(0x907e870) at Limit.pm line 301 FETCH('Name')= 'Pg' ('Name' from cache) at Limit.pm line 301 - FETCH('Driver')= DBI::dr=HASH(0x907e870) at Limit.pm line 338 FETCH('Name')= 'Pg' ('Name' from cache) at Limit.pm line 338 - prepare_cached('INSERT INTO accordi_quadro (codice, data, descrizione, importo_totale, perc_otto) VALUES (?, ?, ?, ?, ?)' HASH(0x90f8df4) ...)= DBI::st=HASH(0x90f8e78) at DBI.pm line 1116 - bind_param(1 '3' ...)= 1 at DBI.pm line 932 - bind_param(2 '2007-01-01' ...)= 1 at DBI.pm line 932 - bind_param(3 'description' ...)= 1 at DBI.pm line 932 - bind_param(4 100 ...)= 1 at DBI.pm line 932 - bind_param(5 65 ...)= 1 at DBI.pm line 932 !! ERROR: 7 'ERROR: una chiave duplicata viola il vincolo accordi_quadro_codice_key ' (err#0) - execute= undef at DBI.pm line 938 - HandleError on DBI::st=HASH(0x90f8e3c) via CODE(0x90e9f00) (undef) ERROR: 7 'ERROR: una chiave duplicata viola il vincolo accordi_quadro_codice_key ' (err#0) - FETCH('Active')= 1 at DBI.pm line 673 ERROR: 7 'ERROR: una chiave duplicata viola il vincolo accordi_quadro_codice_key ' (err#0) - ping= 4 at DBI.pm line 673 !! ERROR: 7 CLEARED by call to rollback method - rollback= 1 at DBI.pm line 838[EMAIL PROTECTED] ~/perl/LettereAttivazione $ DBI_TRACE=1 perl -Mlib=lib script/lettereattivazione_server.pl -d DBI 1.58-nothread default trace level set to 0x0/1 (pid 7372) at DBI.pm line 271 via DBI.pm line 8 [debug] Debug messages enabled [debug] Loaded plugins: .. | Catalyst::Plugin::ConfigLoader 0.14 | | Catalyst::Plugin::FormValidator 0.02 | | Catalyst::Plugin::StackTrace 0.06 | | Catalyst::Plugin::Static::Simple 0.17 | ''