"Dean Harding" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Peter Gissel wrote:
>> I am using the Firebird .Net driver for database io in Visual Studio 2005
>> .Net 2.0 C#. I have three different threads accessing data. I keep 
>> getting
>> "Dynamic SQL Error" Exceptions. The error is fairly random but usually
>> involves an odd character out of place for a field or table name, 
>> resulting
>> in an error. I have tried using a separate connections for each thread, 
>> and
>> I have tried putting all database IO inside Monitor.Enter()/Monitor.Exit
>> blocks, but the error still occurs. If I put all my code into one thread 
>> and
>> run things sequentially the errors go away. I get these errors using a
>> server or embedded. As far as I can tell, this type of access should be 
>> safe
>> as long as I use a unique connection in each thread. I have tried the 
>> some
>> thing with SQL Server 2005 but could not duplicate the error.
>>
>> Is there a thread-safe way to access data using Firebird .Net?
>
> Each connection can only have one command executing at once, but you
> should be using connection pooling anyway (i.e. open connection; execute
> command; close connection) so that shouldn't ever be a problem.
>
> What is the code you're using to generate the commands? and when you get
> the error, what does the statement look like?
>
> Dean.
>

Here is the code. Each thread has it's own connection and reuses it. I put 
together a simple app that reproduces it. Essentially the following code is 
executed in each of three different threads, all doing a different query on 
it's own connection.

FbDataAdapter adapter = new FbDataAdapter("Select * from FilePath where id > 
0", m_connection3);

DataSet tracks = new DataSet();

adapter.Fill(tracks, "FilePath");

Here is a sample error:

Dynamic SQL Error
SQL error code = -204
Table unknown
&ILEPATH
At line 1, column 24



The table name is "FilePath".





-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to