On Thu, 28 Aug 2003, Tim Bunce wrote:

> 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.

It seems related to stored procedure calls, IIRC.  I fought with this 
several months ago and ended up with the hacks below.  My problems are 
very likely due to inconsistancies between DB2 CLI behavior and what one 
would think was the obvious <g>.

> 
> > 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.

I agree 100%.  The existing communications protocol is a fragile, 
hard-to-maintain mess.  This is why I've been putting off a permanent fix.  

Do you agree that the move to something more elegant should involve a 
different set of method names?  That's the only way to avoid breaking 
older code (unless I'm missing the obvious).

Steve

> 
> 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
> > ----------------------------------------------------------------
> > 
> 

-- 
----------------------------------------------------------------
Steven N. Hirsch       tie-line: 446-6557     ext: 802-769-6557

Staff Engineer                     Methodology Integration Team
ASIC Product Development           IBM Microelectronics
----------------------------------------------------------------

Reply via email to