$e->allowed('VIEW_USER_FINES_SUMMARY', $user->home_ou);
}
- return $apputils->simple_scalar_request(
- 'open-ils.storage',
- 'open-ils.storage.money.open_user_summary.search', $user_id );
+ # run this inside a transaction to prevent replication delay errors
+ my $ses = $U->start_db_session();
+ my $s = $ses->request(
+ 'open-ils.storage.money.open_user_summary.search', $user_id )->gather(1);
+ $U->rollback_db_session($ses);
+ return $s;
}
sub user_transaction_history {
my( $self, $conn, $auth, $userid, $type ) = @_;
- my $e = new_editor(authtoken=>$auth);
- return $e->event unless $e->checkauth;
- return $e->event unless $e->allowed('VIEW_USER_TRANSACTIONS');
+
+ # run inside of a transaction to prevent replication delays
+ my $e = new_editor(xact=>1, authtoken=>$auth);
+ return $e->die_event unless $e->checkauth;
+ return $e->die_event unless $e->allowed('VIEW_USER_TRANSACTIONS');
my $api = $self->api_name;
my @xact_finish = (xact_finish => undef ) if ($api =~ /history.still_open$/);
]
) };
+ $e->rollback;
+
my @mbts = _make_mbts( @xacts );
if(defined($type)) {