Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Cvs P5ee > [svn:p5ee] r108...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 678 of 694
Post > Topic >>

[svn:p5ee] r10851 - p5ee/trunk/App-Context/lib/App

by spadkins@[EMAIL PROTECTED] Feb 28, 2008 at 11:50 AM

Author: spadkins
Date: Thu Feb 28 11:50:01 2008
New Revision: 10851

Modified:
   p5ee/trunk/App-Context/lib/App/SharedDatastore.pm

Log:
protect against varying versions of Storable which may cause
deserialization exceptions

Modified: p5ee/trunk/App-Context/lib/App/SharedDatastore.pm
==============================================================================
--- p5ee/trunk/App-Context/lib/App/SharedDatastore.pm	(original)
+++ p5ee/trunk/App-Context/lib/App/SharedDatastore.pm	Thu Feb 28 11:50:01
2008
@[EMAIL PROTECTED]
 -231,7 +231,18 @[EMAIL PROTECTED]
     my ($self, $keyref) = @[EMAIL PROTECTED]
     my $hashkey = $self->hashkey($keyref);
     my $blob = $self->get($hashkey);
-    my $valueref = (defined $blob) ? $self->deserialize($blob) : undef;
+    my ($valueref);
+    if (defined $blob) {
+        eval {
+            $valueref = $self->deserialize($blob);
+        };
+        # we want to catch errors in derialization which may occur due to
version mismatches in the Storable module
+        # (see "man Storable" in section on "FORWARD COMPATIBILITY")
+        if ($@[EMAIL PROTECTED]
) {
+            my $context = $self->{context};
+            $context->log("WARNING:
DataStore($self->{name})->get_ref($hashkey): $@[EMAIL PROTECTED]
");
+        }
+    }
     &App::sub_exit($valueref) if ($App::trace);
     return($valueref);
 }
@[EMAIL PROTECTED]
 -315,7 +326,7 @[EMAIL PROTECTED]
     * Return:    $keyref       any (ref or scalar)
     * Return:    $hashkey      scalar
 
-    $hashkey = $sds->deserialize($keyref);
+    $hashkey = $sds->hashkey($keyref);
 
 =cut




 1 Posts in Topic:
[svn:p5ee] r10851 - p5ee/trunk/App-Context/lib/App
spadkins@[EMAIL PROTECTED  2008-02-28 11:50:02 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed May 14 19:14:49 CDT 2008.