Skip to Content.
Sympa Menu

freetds - RE: [freetds] short read during 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] short read during bcp?
  • Date: Tue, 16 Dec 2003 15:28:22 -0000

Hey James,

> two bcp connections

You mean two dblib connections each using the dblibrary bcp api ?

> Am I the first guy to use bcp on more than one table at a time?

Not sure what you mean...but I regularly do the following (in production
applications)

open two connections to two different databases (servers)
execute stored procedure on connection 1.
(stored procedure returns multiple result sets)

fetch all the data row by row from connection 1, and on connection 2...

on change of result set, call bcp_init for new target table
row by row send the data using bcp_sendrow
call bcp_batch every n rows
call bcp_done when end of data

I can't see why two seperate dblib connections couldn't each be bcping
simultaneously
are these separate threads of the same process ? perhaps thread-safety is
an issue...

HTH,

Bill


> -----Original Message-----
> From: James K. Lowden [SMTP:jklowden AT schemamania.org]
> Sent: 16 December 2003 15:17
> To: FreeTDS Development Group
> Subject: Re: [freetds] short read during bcp?
>
> On Tue, 16 Dec 2003, "Thompson, Bill D (London)" <bill_d_thompson AT ml.com>
> wrote:
> > I've noticed that the server tends to give up and drop the connection if
> > there's something wrong with the packets during a bcp 'interchange'
> > I guess it's because of the low-level nature of bcp.
> > So I'd look for soemthing wrong with the packets we're sending for bcp,
> > rather than the socket programming.
>
> Thanks, Bill. I have to make a decision about an application in the next
> few days: whether to parse & load the data simultaneously with two bcp
> connections, or to write all the data to flat files and load them serially
> with freebcp.
>
> Am I the first guy to use bcp on more than one table at a time? I wonder
> if there's some assumption in our code gets tripped up by two active
> connections.
>
> This isn't multithreaded or anything like that. The data source has
> basically header-detail information; I read the record, write the header
> to one table, and then iterate over the detail records, writing a row
> apiece to the second table. We have many such applications, but none with
> FreeTDS as yet.
>
> I'll focus on the packet format, as you suggest. But, meantime, we do
> have better socket-level complaints in the log. ;-)
>
> --jkl
> _______________________________________________
> 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