[Opensrf-commits] r1381 - trunk/src/perlmods/OpenSRF

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Jul 29 16:42:25 EDT 2008


Author: miker
Date: 2008-07-29 16:42:16 -0400 (Tue, 29 Jul 2008)
New Revision: 1381

Modified:
   trunk/src/perlmods/OpenSRF/AppSession.pm
   trunk/src/perlmods/OpenSRF/Application.pm
Log:
session passing for make_atomic, at least

Modified: trunk/src/perlmods/OpenSRF/AppSession.pm
===================================================================
--- trunk/src/perlmods/OpenSRF/AppSession.pm	2008-07-29 20:00:19 UTC (rev 1380)
+++ trunk/src/perlmods/OpenSRF/AppSession.pm	2008-07-29 20:42:16 UTC (rev 1381)
@@ -1027,6 +1027,13 @@
 
 sub responses { @{$_[0]->{resp}} }
 
+sub session {
+	my $x = shift;
+	my $s = shift;
+	$x->{session} = $s if ($s);
+	return $x->{session};
+}
+
 sub status {}
 
 

Modified: trunk/src/perlmods/OpenSRF/Application.pm
===================================================================
--- trunk/src/perlmods/OpenSRF/Application.pm	2008-07-29 20:00:19 UTC (rev 1380)
+++ trunk/src/perlmods/OpenSRF/Application.pm	2008-07-29 20:42:16 UTC (rev 1381)
@@ -54,6 +54,16 @@
 	return $self->{api_level};
 }
 
+sub session {
+	my $self = shift;
+	my $session = shift;
+
+	if($session) {
+		$self->{session} = $session;
+	}
+	return $self->{session};
+}
+
 sub server_class {
 	my $class = shift;
 	if($class) {
@@ -530,6 +540,8 @@
 		$log->debug("Creating a SubRequest object", DEBUG);
 		unshift @params, $req;
 		$req = OpenSRF::AppSubrequest->new;
+		$req->session( $self->session ) if ($self->session);
+
 	} else {
 		$log->debug("This is a top level request", DEBUG);
 	}
@@ -712,8 +724,12 @@
 	my @args = @_;
 
 	(my $m_name = $self->api_name) =~ s/\.atomic$//o;
-	my @results = $self->method_lookup($m_name)->run(@args);
+	my $m = $self->method_lookup($m_name);
 
+	$m->session( $req->session );
+	my @results = $m->run(@args);
+	$m->session('');
+
 	return \@results;
 }
 



More information about the opensrf-commits mailing list