Skip to Content.
Sympa Menu

freetds - RE: [freetds] Status: bcp

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Thompson, Bill D (London)" <bill_d_thompson AT ml.com>
  • To: "'FreeTDS Development Group'" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] Status: bcp
  • Date: Fri, 19 Dec 2003 13:22:54 -0000

Some more...

> I'm guessing therefore that some of our code is now more sensitive to
> the TDS_DEAD state than it used to be.

Indeed....it's this check that stops the program in it's tracks after
generating the "batch success..." message

static int
tds_to_quering(TDSSOCKET * tds)
{
if (tds->state == TDS_DEAD) {
tds_client_msg(tds->tds_ctx, tds, 20006, 9, 0, 0, "Write to SQL
Server failed. ");
return TDS_FAIL;


Bill

> -----Original Message-----
> From: Thompson, Bill D (London)
> Sent: 19 December 2003 13:11
> To: 'FreeTDS Development Group'
> Subject: RE: [freetds] Status: bcp
>
> Hi,
>
> here's some (fairly random) analysis of the issues:
>
> 1) Sybase open client does NOT put out the message. I recompiled the new
> test program against Sybase to prove it.
>
> 2) where did the message come from ? searching through my memory banks, I
> remember going through sybase's sybdb.h for any bcp related error messages
> and then tried to fit them into the appropriate place in the code. Of
> course I stumbled across:
>
> #define SYBEBBCI 20068 /* Batch successfully bulk-copied to SQL
> Server. */
>
> and put it into my code where it seemed to belong.
>
> 3) My production code copes quite happily with the generation of these
> messages, even tho' my dblib error handler returns INT_CANCEL.
> My version of tds_client_msg() still sets tds->state to TDS_DEAD.
>
> ret = tds_ctx->err_handler(tds_ctx, tds, &msg_info);
> tds_free_msg(&msg_info);
> /* message handler returned FAIL/CS_FAIL
> * mark socket as dead */
> if (ret && tds) {
> tds->state = TDS_DEAD;
> }
>
> I'm guessing therefore that some of our code is now more sensitive to
> the TDS_DEAD state than it used to be.
> and some pretty crude evidence might support that guess...
>
> grep 'DEAD' <my production source>/tds/*.c
>
> read.c: if (IS_TDSDEAD(tds) || (rc = tds_read_packet(tds))
> <
> 0)
> token.c: if (IS_TDSDEAD(tds)) {
> token.c: tds->state = TDS_DEAD;
> token.c: if (IS_TDSDEAD(tds))
> token.c: tds->state = TDS_DEAD;
> token.c: tds->state = TDS_DEAD;
> util.c: if (!IS_TDSDEAD(tds)) {
> write.c: if (!IS_TDSDEAD(tds)) {
>
> grep 'DEAD' <my current source>/tds/*.c
>
> query.c: if (tds->state == TDS_DEAD) {
> read.c: if (IS_TDSDEAD(tds))
> read.c: if (IS_TDSDEAD(tds) || (rc = tds_read_packet(tds))
> <
> 0)
> read.c: if (IS_TDSDEAD(tds)) {
> read.c: tdsdump_log(TDS_DBG_NETWORK, "Read attempt when state is
> TDS_DEAD");
> token.c: if (IS_TDSDEAD(tds)) {
> token.c: tds->state = TDS_DEAD;
> token.c: if (IS_TDSDEAD(tds))
> token.c: tds->state = TDS_DEAD;
> token.c: if (IS_TDSDEAD(tds))
> token.c: if (IS_TDSDEAD(tds))
> token.c: if (IS_TDSDEAD(tds))
> token.c: if (IS_TDSDEAD(tds))
> token.c: tds->state = TDS_DEAD;
> token.c: if (retcode == TDS_SUCCEED && !IS_TDSDEAD(tds))
> util.c: if (!IS_TDSDEAD(tds)) {
> write.c: if (!IS_TDSDEAD(tds)) {
>
>
> HTH,
>
> Bill
>
> > -----Original Message-----
> > From: Lowden, James K [SMTP:LowdenJK AT bernstein.com]
> > Sent: 18 December 2003 22:13
> > To: 'FreeTDS Development Group'
> > Subject: RE: [freetds] Status: bcp
> >
> > > From: Castellano, Nicholas
> > > Sent: December 18, 2003 4:13 PM
> > >
> > > These SYBEBBCI messages are definitely required when
> > > bcp_exec() is used, and
> > > I have code that relies on this behavior.
> > >
> > > I don't know enough about the other parts of the bcp API to
> > > say for certain
> > > whether it's specific to bcp_exec() or not.
> >
> > What does your handler return?
> >
> > --jkl
> > -----------------------------------------
> > The information contained in this transmission may contain privileged
> and
> > confidential information and is intended only for the use of the
> person(s)
> > named above. If you are not the intended recipient, or an employee or
> > agent responsible for delivering this message to the intended recipient,
> > any review, dissemination, distribution or duplication of this
> > communication is strictly prohibited. If you are not the intended
> > recipient, please contact the sender immediately by reply e-mail and
> > destroy all copies of the original message. Please note that we do not
> > accept account orders and/or instructions by e-mail, and therefore will
> > not be responsible for carrying out such orders and/or instructions.
> >
> >
> > _______________________________________________
> > FreeTDS mailing list
> > FreeTDS AT lists.ibiblio.org
> > http://lists.ibiblio.org/mailman/listinfo/freetds
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds





Archive powered by MHonArc 2.6.24.

Top of Page