[freetds] Exececute procedure returns errors

James K. Lowden jklowden at schemamania.org
Mon Jul 26 22:42:50 EDT 2004


On Mon, 26 Jul 2004 David Keith <dkeith at logisticshealth.com> wrote:
> I've been trying to track down a problem between Kylix, ODBCExpress,
> AstaIO, unixODBC, freeTDS and MS SQL 2K. Looks like freeTDS may be the
> culprit, although I'm not completly certain.  I'm attempting to execute
> a stored procedure that has input params and returns one output param.
> If I don't explicitly start/commit/end the transaction, I get an error,
> here's a snippet from the freetds.log:
...
> tds_submit_query(): state is PENDING
> 17:34:17.419652 tds_client_msg: #20019: "Attempt to initiate a new SQL
> Server operation with results pending.".  Connection state is now 1.
...
> What's strange is that if I start up a single user app that has the
> ODBCExpress components on the app, and only uses one session, I can get
> this to work. If I try to execute the storedproc via a threaded session
> in my AstaIO daemon, I get the above errors.

A little more of the above log might help.  I'd suspect two threads
sharing a connection.  As far as the server's concerned, there are no
threads.  There are only connections, and each connection must finish
reading its results before initiating another query.  Two threads not
cooperating in their use of a connection could result in the 20019 error. 


--jkl



More information about the FreeTDS mailing list