[SCM] libmagpie-perl Debian packaging branch, master, updated. debian/1.131250-1-12-g2aa5938

Kip Hampton khampton at totalcinema.com
Thu May 9 12:24:20 UTC 2013


The following commit has been merged in the master branch:
commit 95dbe5a9db9a78430b59c04e591c7d22598d4903
Author: Kip Hampton <khampton at totalcinema.com>
Date:   Wed May 8 10:52:21 2013 -0700

    Wrap potentially volatile operations in transactions.

diff --git a/lib/Magpie/Resource/Kioku.pm b/lib/Magpie/Resource/Kioku.pm
index 5f4a09b..01ed6af 100644
--- a/lib/Magpie/Resource/Kioku.pm
+++ b/lib/Magpie/Resource/Kioku.pm
@@ -186,7 +186,9 @@ sub POST {
             }
 
             try {
-                $self->data_source->store($existing);
+                $self->data_source->txn_do( sub {
+                    $self->data_source->store($existing);
+                });
             }
             catch {
                 my $error = "Error updating data entity with ID $existing_id: $_\n";
@@ -219,7 +221,9 @@ sub POST {
     my $id = undef;
 
     try {
-        $id = $self->data_source->store($to_store);
+        $self->data_source->txn_do( sub {
+            $id = $self->data_source->store($to_store);
+        });
     }
     catch {
         my $error = "Could not store POST data in Kioku data source: $_\n";
@@ -257,7 +261,9 @@ sub DELETE {
 
     # should we do a separate lookup to make sure the data is there?
     try {
-        $self->data_source->delete( $id );
+        $self->data_source->txn_do( sub {
+            $self->data_source->delete( $id );
+        });
     }
     catch {
         my $error = "Could not delete data from Kioku data source: $_\n";
@@ -336,7 +342,6 @@ sub PUT {
         $self->set_error( { status_code => 500, reason => $error } );
     };
 
-    warn "should be stored";
     return OK if $self->has_error;
 
     # finally, if it all went OK, say so.

-- 
libmagpie-perl Debian packaging



More information about the Pkg-perl-cvs-commits mailing list