Hello all,
I'm sorry if it is the wrong list, but I thought it was more a
Catalyst-specific issue than a DBIx::Class one, as it is about the way
Catalyst uses DBIx::Class.
I would like to use transactions in Catalyst.
my $transaction = $c-model('MyAppDB')-storage;
$transaction-txn_begin;
eval
Xavier Robin wrote:
Hello all,
I'm sorry if it is the wrong list, but I thought it was more a
Catalyst-specific issue than a DBIx::Class one, as it is about the way
Catalyst uses DBIx::Class.
I would like to use transactions in Catalyst.
my $transaction = $c-model('MyAppDB')-storage;
On 1/4/07, Xavier Robin [EMAIL PROTECTED] wrote:
[...]
my $transaction = $c-model('MyAppDB')-storage;
$transaction-txn_begin;
eval {
# Do some insertions with $c-model('MyAppDB::Table')-create()
};
if ($@) {
$transaction-txn_rollback;
}
else {
$transaction-txn_commit;
}
Fist of
On Thu, Jan 04, 2007 at 11:11:10AM +, Ash Berlin wrote:
$c-model('MyAppDB')-txn_do(sub {
# Do some insertions here
});
Yes, this is pretty much how I do it too, e.g.:
sub _add_new_reply {
my ($self, $c) = @_;
my ($new_reply);
# some checks
# otherwise, the form
On Thu, Jan 04, 2007 at 10:45:49AM +0100, Xavier Robin wrote:
Hello all,
I'm sorry if it is the wrong list, but I thought it was more a
Catalyst-specific issue than a DBIx::Class one, as it is about the way
Catalyst uses DBIx::Class.
Related to Catalyst, my do_transaction is in my base
Xavier Robin wrote:
I mean, my application died once before the rollback and everything went
wrong. I think this is because Catalyst connects only once, so all the work
is done under the same connexion.
That doesn't really make sense. It can't use the same connection from
different