[python-sybase] Re: This routine cannot be called because another
command structure has results pending
Andrew McNamara
andrewm at object-craft.com.au
Fri Jul 14 12:34:27 EST 2006
>I tried the "_close_fetcher" solution, but it has caused other problems.
>Specifically, it throws off the lock count and I end up getting:
>
> AssertionError: release() of un-acquire()d lock
Ah, that's a shame. So much for the change being simple and obviously
correct!
>What has been working for me is simply clearing the command once the lock
>count reaches zero. Here is what my version of _FetchLazy._unlock looks like:
>
> def _unlock(self):
> self._lock_count = self._lock_count - 1
> _ctx.debug_msg('_unlock: count -> %d\n' % self._lock_count)
> #!!! Added by DRC: Once there are no more locks, clear the command
> if self._lock_count == 0:
> status = self._cmd.ct_cancel(CS_CANCEL_ALL)
> #!!!
> self._owner._unlock()
Well, that looks good, but I've said that before... 8-)
Greg?
--
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/
More information about the Python-sybase
mailing list