On Aug 29, 2006, at 4:29 PM, [EMAIL PROTECTED] wrote:

Ah! I think I know what happens...

You probably have the syb_flush_finish attribute turned on - which means that DBD::Sybase will try to fetch all the results that are pending for the
active sth.

That's most certainly it! I also forgot about syb_flush_finish which is a necessity in my environment.

I'm going to have to look at the code to see how that could be invalidated
(or fixed!)

Well I think there is a simple solution: right before undef'ing the dbh or sth, I can update the dbh to turn off syb_flush_finish, which is quite logical and should be done by the client (who else can know better about a signal interrupt state?)

However, at that time the dbh may well be in a bad state since it's right after a signal interrupt. But turning off syb_flush_finish is a simple integer assignment to a dereference of imp_dbh, and it shouldn't be an issue even after an interrupt. Below is the relevant code:

if (kl == 16 && strEQ(key, "syb_flush_finish")) {
        on = SvTRUE(valuesv);
        if(on) {
                imp_dbh->flushFinish = 1;
        } else {
                imp_dbh->flushFinish = 0;
        }
        return TRUE;
}

Thanks for the help, Michael.

Henri.



Michael




Extranet
[EMAIL PROTECTED] - 29/08/2006 15:56

To:    dbi-users

cc:


Subject:    Re: finishing sth using Childhandles




On Aug 29, 2006, at 2:08 PM, [EMAIL PROTECTED] wrote:


As you see this calls the DESTROY for the sth (which cancels the
query),
and then calls the DESTROY for the dbh (which closes the
connection). There
is no special code in DBD::Sybase to handle this case AFAIK.


Thanks, I didn't have easy access to a DBI-enabled machine today :-)
However, the dbh undef calls the sth DESTROY which calls the sth
finish(), and the sth finish can, in some cases, throw an error such
as the one I had that says :
dbih_setup_fbav: invalid number of fields: -1, NUM_OF_FIELDS
attribute  probably not set right

The "in some cases" above is after a signal interrupt, when the sth
is potentially a bad state.
So how do I clear the sth when I know it's in a bad state, without
calling finish() that expects the sth to be in a workable state?

 H




This message and any attachments (the "message") is
intended solely for the addressees and is confidential.
If you receive this message in error, please delete it and
immediately notify the sender. Any use not in accord with
its purpose, any dissemination or disclosure, either whole
or partial, is prohibited except formal approval. The internet
can not guarantee the integrity of this message.
BNP PARIBAS (and its subsidiaries) shall (will) not
therefore be liable for the message if modified.

                ---------------------------------------------

Ce message et toutes les pieces jointes (ci-apres le
"message") sont etablis a l'intention exclusive de ses
destinataires et sont confidentiels. Si vous recevez ce
message par erreur, merci de le detruire et d'en avertir
immediatement l'expediteur. Toute utilisation de ce
message non conforme a sa destination, toute diffusion
ou toute publication, totale ou partielle, est interdite, sauf
autorisation expresse. L'internet ne permettant pas
d'assurer l'integrite de ce message, BNP PARIBAS (et ses
filiales) decline(nt) toute responsabilite au titre de ce
message, dans l'hypothese ou il aurait ete modifie.


Reply via email to