If I Had a Hammer

jk2addict on 2007-10-22T20:59:45

After a thread on the dbix-class mailing list about rollback and transactions, I find myself wanting a language wide transaction scope for Perl.

One of the things I like about .NET 2.0 is the transaction scope, wherein anything that is transaction-aware can participate in a transaction scoped block of code, even things that have nothing to do with databases, like file system operations.

If I wanted to update a db (DBI, or DBIC, RDBO, Muldis, an any other) record, update a copy in subversion, plop out a new static html page, and send a confirmation email, it would be keen to wrap that all up in one transaction scope.

My brain melts at the thought of how one would even go about making such a framework in Perl, but it would be a damn fun project.


no perl6?

fireartist on 2007-10-23T08:30:01

I fully expected to see a reply already, along the lines of "this is how you'll do it in perl 6..."

Re:no perl6?

jk2addict on 2007-10-23T13:22:55

I've seen the P6 page on transactional scalars, ref, etc, but it still reads a little thin on the overall picture. I didn't do a lot of searching though.

And of course, that's Perl6, which at this point isn't 'real' for me yet.

ReleaseAction

btilly on 2007-10-24T21:26:38

...has a comment that its on_release can be used to implement transactional mechanics. That comment was there for good reason - I've actually used it that way.

It is a little bare-bones though. OK, a lot bare-bones.