Convenient SQL transactions with PressFlow Transaction

Events happening in the community are now at Drupal community events on www.drupal.org.
david strauss's picture

I've released an in-development version of PressFlow Transaction for developers interested in convenient encapsulation of SQL transactions. The key features are intelligent use of scope for COMMITs and ROLLBACKs as well as safe, intelligent nesting of transactions to get exception-like semantics.

Usage details are on the project page. Requires PHP 5.

(I posted this to the High-Performance group because encapsulating updates in transactions can dramatically improve performance.)

Comments

Use cases please

Amazon's picture

Can you cite some use cases for PressFlow and give some examples were improvements effected overall system performance?

Thanks,
Kieran

To seek, to strive, to find, and not to yield

New Drupal career! Drupal profile builders.
Try pre-configured and updatable profiles on CivicSpaceOnDemand

This is not about performance...

boris mann's picture

...it's about transactional reliability: no screw ups from stuff that doesn't complete. An advanced version of "undelete" that has been talked about.

Yea...

jlambert's picture

Yea, it's about single phase commit support for ACID compliant databases. Won't do any good if you don't have the transaction support for a two phase in the platform. Yay. Nice work...

Great work

Souvent22's picture

David,

This is great work. Simple, yet effective. This has so many implications, I don't know where to begin.

This also makes me think a section needs to be added to the handbook (perhaps under coding guidelines) to talk about transactions; both application level and database level (which are different), and coding patterns/guidelines for them. Hopefully this makes it in to the e-commerce modules :).

Agreed, this def. is not about performance; the performance benefits (IMHO) of updates in transactions I think are minimal, and are well over shadowed by the other items this module facilitates.

For ref (and this is in no way thorough): The performance benefits come from the updates happening on a locked "open" section/state of the database, and then committed as "one". I use general words like "open"/"state" because it some what depends on the implementation the database uses (opening a file, grabbing a thread-lock, etc.).

Anyway, if I can keep solidifying my quickbooks module, PFT (PressFlow Transactions) will def. make it in as a requirement.......

On another note...I wish something like this was in core. Core is clean perfect....but like anything, every so often in the mass of chaos somewhere b/t the motherboard, memory, the OS, PHP, web-server, etc. a "hiccup" occurs. It would be nice to be able to catch this "hiccup" in something like this. Gosh, lets just extend that:
It would be nice that I knew that module x,y,z that I am using in my stack all did their job and I can commit my transaction from and application level.

Ok, i'm off my soapbox. cheers. nice work again.

e-Commerce Module

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: