I have a thread repeatly running stored procedures to insert and update tables. When I run 100 instances or more of the same thread, sometimes when starting the application I received the following exception, either the first or the second:
1. FirebirdSql.Data.FirebirdClient.FbException: I/O error for file CreateFile (open) "tmcdb.fdb" Error while trying to open file
2. FirebirdSql.Data.FirebirdClient.FbException: internal gds software consistency check (can't continue after bugcheck)
The problem only occurs at the first round of threads' execution. If the first round is fine, it will continue running with no problem.
I am using Firebird ADO.NET Data Provider 2.0 RC1 (version 2.0.50727). I am using connection pool of size 1000. For every transaction I open a connection and close it right after the transaction is committed or rolled back. The database is embedded with fbembed.dll(v.1.5.3.4870).
The (simplified) code is as below:
------------------------------------
public int ExecuteStoredProcedure(string sqlCommand, ref IList paramList)
{
int retval = 0;
FbConnection conn;
GetFBConnection(out conn);
FbCommand fbCommand;
fbCommand = conn.CreateCommand();
fbCommand.CommandText = sqlCommand;
if (paramList != null)
foreach (Object obj in paramList)
{
fbCommand.Parameters.Add(obj);
}
fbCommand.CommandType = System.Data.CommandType.StoredProcedure;
FbTransaction txn = null;
txn = conn.BeginTransaction(FbTransactionOptions.Concurrency);
fbCommand.Transaction = txn;
retval = fbCommand.ExecuteNonQuery();
txn.Commit();
ReleaseFBConnection(conn);
fbCommand.Dispose();
return retval;
}
private void GetFBConnection(out conn)
{
FbConnection fbc = new FbConnection(_connectionString);
fbc.Open();
conn = fbc;
}
private void ReleaseFBConnection(FbConnection fbc)
{
fbc.Close();
fbc.Dispose();
}
Do I need to do anything more to ensure thread safety?
Thank you!
Sean
Groups are talking. We´re listening. Check out the handy changes to Yahoo! Groups.
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider