[jifty-devel] JDBI transactions

Andrew Sterling Hanenkamp andrew.hanenkamp at boomer.com
Thu Mar 15 08:49:21 EDT 2007


I wasn't thinking of using save points at all, actually. I was thinking
more of batching the queries up for use and clearing sections of the
batch on rollback. For those DBs that implement them, save points are
certainly the optimal way to go. I'm not sure why I didn't consider
them, I'll add them into the mix. (This is why I ask for comments... ;)

However, I'll still look into implementing it both in Perl and in SQL so
that we can rely on our transactions to some extent even if our DB does
not support save points (e.g., SQLite) or even if a DB doesn't support
transactions at all (e.g., DBD::CSV).


--
Andrew Sterling Hanenkamp
Interaction Developer
Boomer Consulting, Inc.
 
1.785.537.2358 ext. 17
1.888.266.6375 ext. 17
1.785.537.4545 (fax)
 
610 Humboldt
Manhattan, KS 66502
 
http://www.boomer.com/about/team/andrew-hanenkamp.html
andrew.hanenkamp at boomer.com

-----Original Message-----
From: jifty-devel-bounces at lists.jifty.org
[mailto:jifty-devel-bounces at lists.jifty.org] On Behalf Of Ruslan Zakirov
Sent: Thursday, March 15, 2007 7:23 AM
To: Nifty apps in a Jiffy
Subject: Re: [jifty-devel] JDBI transactions

On 3/13/07, Andrew Sterling Hanenkamp <andrew.hanenkamp at boomer.com>
wrote:
>
>
> While looking into a way to make the V-M class instantiation work 
> better, I did some digging in JDBI transactions. I got to thinking 
> about it and was thinking that it would be nice to have a transaction 
> system that could do the following:
>
> Truly nested transactions: If a rollback is nested within a commit, 
> the code of that rollback is removed from the ultimate commit (which 
> is not currently the case, as far as I can tell).
As I far as I know mysql doesn't support nested transactions, but has
save points which could be used to do this, however I never tried it.

> The ability to store code as part of a transaction that gets run on 
> ultimate commit or on ultimate rollback.
Yes, this is great idea if I got it right :)

> Creating a "transaction { }" wrapper method that will execute a 
> coderef  and perform automatic rollback on exception or automatic
commit otherwise.
> Encapsulating transactions in objects that could be manipulated in a 
> straightforward manner---rather than as a collection of methods on 
> Jifty::DBI::Handle.
Sounds cool.

> I looked around on CPAN to see if there was already a module for 
> helping with this, but the modules either require wrapping DBI (e.g.,
> DBIx::Transaction) or don't really work the way I have described 
> (e.g., DBIx::Roles::Transaction). All the transaction modules I see 
> are also tied to some specific file- or DBI-based task and don't 
> provide tools to help with the execute on commit/rollback feature.
>
> Ideas or comments?
>
> Cheers,
> Andrew
>
>
> --
> Andrew Sterling Hanenkamp
> Interaction Developer
> Boomer Consulting, Inc.
>
> 1.785.537.2358 ext. 17
> 1.888.266.6375 ext. 17
> 1.785.537.4545 (fax)
>
> 610 Humboldt
> Manhattan, KS 66502
>
> http://www.boomer.com/about/team/andrew-hanenkamp.html
> andrew.hanenkamp at boomer.com
>
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
>
>


--
Best regards, Ruslan.
_______________________________________________
jifty-devel mailing list
jifty-devel at lists.jifty.org
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel


More information about the jifty-devel mailing list