Is this patch the best there is?
Right now I'm doing a database-heavy project. One thread is doing a heavy ingest of data while I have 3 others doing nothing but reading - and I don't care whether the readers get the absolute latest data as accuracy isn't important during ingest. I'm running into database locked if my datareader takes too long.
Aside from changing the timeout is there any way to avoid this other than this patch?
My usual reading structure is something along the lines of:
using (DbTransaction dbTrans = conceptDatabaseConnection.BeginTransaction())
{
using (DbCommand cmd = conceptDatabaseConnection.CreateCommand())
{
cmd.CommandText = "SELECT id FROM myTable WHERE myColumn= ?";
DbParameter myParam = cmd.CreateParameter();
cmd.Parameters.Add(myParam );
myParam.Value = myValue;
using (DbDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
myVarList.Add(reader[0]);
}
}
}
dbTrans.Commit();
}
From what I understand there's no way in the ADO wrapper to make the reader not lock out my writer. Is this true?
EDIT: On a sidenote - why am I manually having to type html in order to properly format a forum post...