On Thu, Aug 28, 2003 at 09:50:21AM -0400, Steven N. Hirsch wrote:
>
> Tim,
>
> I plan to beat on this over the next few days. However, here are two
> small changes which I've found to be necessary when working with a DB2
> backend database. Since making these mods all ugly messages are a thing
> of the past.
>
> In my opinion, it's time to throw in the towel and report the true
> 'Active' status back to the proxy client with every call.
I'd *really* like to know under what circumstances the Active status
gets out of sync.
> I'm getting
> hammered at work, but will attempt to code this up "Real Soon Now" <g>.
Any patch to report the server-side active status needs to a) gracefully
handle client-server version mismatches, and b) ideally implement a more
flexible protocol in general so that new features can be added and version
mismatches more gracefully handled in future.
Tim.
> Steve
>
>
> --- DBI-1.38/lib/DBD/Proxy.pm.orig Tue Aug 19 20:15:28 2003
> +++ DBI-1.38/lib/DBD/Proxy.pm Thu Aug 28 09:44:22 2003
> @@ -352,8 +352,10 @@
> $sth->{'proxy_sth'} = $rsth;
> # If statement is a positioned update we do not want any readahead.
> $sth->{'RowCacheSize'} = 1 if $stmt =~ /\bfor\s+update\b/i;
> - # Since resources are used by prepared remote handle, mark us active.
> - $sth->SUPER::STORE(Active => 1);
> + # In a perfect world, this would be correct. However, until a clean
> + # universal solution is implemented for keeping the client in sync
> + # with the backend database, refrain from making a leap of faith.
> + # $sth->SUPER::STORE(Active => 1);
> }
> $sth;
> }
> @@ -577,7 +579,9 @@
>
> sub finish ($) {
> my($sth) = @_;
> - return 1 unless $sth->SUPER::FETCH('Active');
> + # For reasons remarked upon in disconnect() above, let the
> + # user decide when to hit the wire.
> + # return 1 unless $sth->SUPER::FETCH('Active');
> my $rsth = $sth->{'proxy_sth'};
> $sth->SUPER::STORE('Active' => 0);
> return 0 unless $rsth; # Something's out of sync
>
>
> --
> ----------------------------------------------------------------
> Steven N. Hirsch tie-line: 446-6557 ext: 802-769-6557
>
> Staff Engineer Methodology Integration Team
> ASIC Product Development IBM Microelectronics
> ----------------------------------------------------------------
>