Env: TS 6.1 W2K3, OD/DD 6, MS SQL Server
Problem: I was using the IWExternalDataSource interface of DD to generate a portion of the tuple that I'm about to write (I'm writing metadata, rather than DCR data, but I doubt that matters). The example code that ships with DataDeploy shows random data generation, but I figured it wouldn't be a problem to switch it to data generated from the database.
Wrong
I'm actually trying to generate an ID column for my row, or use the existing ID if the row already exists. So I run a query against the table. If I find a match, I return that ID. If not, then I generate an ID and return that instead. This is run as a part of a workflow, so I'm using a file list to tell DD which files to deploy. It works great if my file list contains only one file. However, if it contains two, I have problems. The query that I run to look up the existing ID fails for the second file with a timeout error. So my exception handler takes over, and I generate a new ID. That's fine, except that now I've got two IDs for the same file, which is a definite no-no.
All I can think of is that, because DD has just written to the "master" table for the prior file, it's got it "locked" some how so that I can't read it for the next file, resulting n the timeout error.
I was using the External Data source interface because it provided a pre-built database connection object. However, later requirements have mandated that I ALSO have a database connection in my TupleFilter class. So I moved my ID generation logic out of the External source interface and into my TupleFilter code. Same result.
I AM using a static class variable to store my Connection object, as a performance enhancement. I'm rebuilding now, to see if connecting/disconnecting makes a difference, but I'd rather not do that if I don't have to. Assuming it works.
Any ideas?
--

Current project: TS 5.5.2/6.1 W2K