Re: [Catalyst] how to implement Transactions (over different db tables) in a Catalyst project

2009-07-07 Thread Ali M.
Kakimoto I recommend you read this article http://blog.urth.org/2009/07/what-is-catalyst-really.html It might help you understand more when its a Catalyst Issue or a another component issue! And help you better trouble shoot your problems. Apparently Catalyst will help you send a request to the

Re: [Catalyst] how to implement Transactions (over different db tables) in a Catalyst project

2009-07-07 Thread Tomas Doran
kakim...@tpg.com.au wrote: Sorry, after reading it again after the many responses to this thread, I realised it's ok. It's _NOT OK_, as you didn't get it first time. So it's obviously not clear *enough*. Please supply the DBIC list with a doc patch to make it more clear and explicit.

Re: [Catalyst] how to implement Transactions (over different db tables) in a Catalyst project

2009-07-06 Thread Tomas Doran
On 6 Jul 2009, at 06:30, kakim...@tpg.com.au wrote: In the past, when I had to work with just DBI, I would manually start a transaction and commit it at the end if no exceptions occur. In the case of the latter, I will call a rollback. This is fairly easy to get wrong - txn_do forces you

Re: [Catalyst] how to implement Transactions (over different db tables) in a Catalyst project

2009-07-06 Thread kakimoto
hello there, Tomas, Thank you :) Yes, you're quite right there:) Prior to receiving this reply, I actually wrapped my existing code in the subroutine within an sub for the txn_do. sub save_complete_records { ... eval { $c-model('myAppDB')-schema-txn_do( sub {

Re: [Catalyst] how to implement Transactions (over different db tables) in a Catalyst project

2009-07-06 Thread Tomas Doran
Tomas Doran wrote: $c-model('myAppDB')-txn_do( sub { my $rs = $c-model('myAppDB::Table')-search(..); # Etc etc die(Rollback) if $foo; # Exceptions cause rollback # Etc etc # If you get here, to the end, transaction is committed for you. }); And I'm crap. You need

Re: [Catalyst] how to implement Transactions (over different db tables) in a Catalyst project

2009-07-06 Thread kakimoto
hi Tomas and everyone:) I still have some questions as per my prev post. Can you please help me out? :) I have the following questions: 1) I looked at the terminal with all the debug messages. I noticed that the exception was caught and eventhough the roll back was done, I do not see the

Re: [Catalyst] how to implement Transactions (over different db tables) in a Catalyst project

2009-07-06 Thread kakimoto
So, in the case of an exception, an automatic rollback will take place. I have tested this in my application and it seems that way. Can anyone confirm this? Thank you:) This is fairly easy to get wrong - txn_do forces you to have a block which comprises the transaction scope, or your code

Re: [Catalyst] how to implement Transactions (over different db tables) in a Catalyst project

2009-07-06 Thread Joel Bernstein
On 6 Jul 2009, at 12:38, kakim...@tpg.com.au wrote: So, in the case of an exception, an automatic rollback will take place. I have tested this in my application and it seems that way. Did you look what the code does?

Re: [Catalyst] how to implement Transactions (over different db tables) in a Catalyst project

2009-07-06 Thread Tomas Doran
On 6 Jul 2009, at 12:32, kakim...@tpg.com.au wrote: hi Tomas and everyone:) I still have some questions as per my prev post. Can you please help me out? :) Sorry, this is too far into DBIC land for this list IMO. Please ask on that list. Cheers t0m

Re: [Catalyst] how to implement Transactions (over different db tables) in a Catalyst project

2009-07-06 Thread Tomas Doran
On 6 Jul 2009, at 12:38, kakim...@tpg.com.au wrote: So, in the case of an exception, an automatic rollback will take place. I have tested this in my application and it seems that way. Can anyone confirm this? Did you even look for this in the manual?

Re: [Catalyst] how to implement Transactions (over different db tables) in a Catalyst project

2009-07-06 Thread kakimoto
Did you look what the code does? http://cpansearch.perl.org/src/RIBASUSHI/DBIx-Class-0.08107/lib/DBIx/Class/Storage.pm and http://cpansearch.perl.org/src/RIBASUSHI/DBIx-Class-0.08107/t/81transactions.t If the API doc is written well, I suppose one doens't need to look at the source code

Re: [Catalyst] how to implement Transactions (over different db tables) in a Catalyst project

2009-07-06 Thread kakimoto
Did you even look for this in the manual? http://search.cpan.org/~ribasushi/DBIx-Class-0.08107/lib/DBIx/Class/ Storage.pm#txn_do If not, why not. If so, how is this not clear? Well, it's really clear now . I suppose someone has updated the documentation since I posted this thread

Re: [Catalyst] how to implement Transactions (over different db tables) in a Catalyst project

2009-07-06 Thread Andrew Rodland
On Monday 06 July 2009 05:37:49 pm kakim...@tpg.com.au wrote: Did you even look for this in the manual? http://search.cpan.org/~ribasushi/DBIx-Class-0.08107/lib/DBIx/Class/ Storage.pm#txn_do If not, why not. If so, how is this not clear? Well, it's really clear now . I suppose

Re: [Catalyst] how to implement Transactions (over different db tables) in a Catalyst project

2009-07-06 Thread J. Shirley
On Mon, Jul 6, 2009 at 3:36 PM, kakim...@tpg.com.au wrote: However, this is NOT a Catalyst question. Please subscribe to the DBIx::Class users list at: http://lists.scsys.co.uk/mailman/listinfo/dbix-class/ and ask these questions there. Many of the subscribers are the same, but many

Re: [Catalyst] how to implement Transactions (over different db tables) in a Catalyst project

2009-07-06 Thread kakimoto
On Tue, Jul 7th, 2009 at 8:54 AM, J. Shirley jshir...@gmail.com wrote: On Mon, Jul 6, 2009 at 3:36 PM, kakim...@tpg.com.au wrote: there's somethign wrong with the mailing list for Dbix::Class as I have not been able to get replies /mails. I have contacted the admin in the past and never