Table ... doesn't exist
Posted: Mon 18 Dec 2006 04:18
Since we upgraded to version 3.50 of the MySQL Direct driver, we occasionally get the exception below (2-3 times a week). The table it is complaining about is there (and it always complains about the same table [so far]). We are using VS 2005 and MySQL 5.0.22. If I simply re-execute the same line that gave the exception, it runs fine. I do not know how to duplicate it. It did not happen with the previous version of MySQLDirect.
CoreLab.MySql.MySqlException occurred
Message="Table 'Global.Item' doesn't exist"
Source="CoreLab.MySql"
ErrorCode=-2147467259
Code=1146
SqlState="42S02"
StackTrace:
at CoreLab.MySql.a2.n()
at CoreLab.MySql.a2.c()
at CoreLab.MySql.c.a(f[]& A_0, Int32& A_1)
at CoreLab.MySql.c.a(Byte[] A_0, Int32 A_1, Boolean A_2)
at CoreLab.MySql.w.d()
at CoreLab.MySql.MySqlCommand.a(CommandBehavior A_0, IDisposable A_1, Int32 A_2, Int32 A_3)
at CoreLab.Common.DbCommandBase.b(CommandBehavior A_0)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at Samys.DataAccessLayer.DAL.ExecuteReader(String sqlString) in G:\devel\dotNet\Samys\DataAccessLayer\DAL.cs:line 119
The line giving the exception is:
return command.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
Please advise.
Thanks,
Lars
Ps. The only write-operation that ever takes place against the table mentioned in the exception is the code below (pseudo code), and it only runs at once a day (at 5.30 am in the morning):
LOCK TABLES $Destination_Table WRITE
DROP TABLE IF EXISTS `$Destination_Table`
ALTER TABLE `$Source_Table` RENAME `$Destination_Table`
UNLOCK TABLES
Even if an application tried to read from the table at the same time as this happened, it should only result in a very brief delay (not an exception).
CoreLab.MySql.MySqlException occurred
Message="Table 'Global.Item' doesn't exist"
Source="CoreLab.MySql"
ErrorCode=-2147467259
Code=1146
SqlState="42S02"
StackTrace:
at CoreLab.MySql.a2.n()
at CoreLab.MySql.a2.c()
at CoreLab.MySql.c.a(f[]& A_0, Int32& A_1)
at CoreLab.MySql.c.a(Byte[] A_0, Int32 A_1, Boolean A_2)
at CoreLab.MySql.w.d()
at CoreLab.MySql.MySqlCommand.a(CommandBehavior A_0, IDisposable A_1, Int32 A_2, Int32 A_3)
at CoreLab.Common.DbCommandBase.b(CommandBehavior A_0)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at Samys.DataAccessLayer.DAL.ExecuteReader(String sqlString) in G:\devel\dotNet\Samys\DataAccessLayer\DAL.cs:line 119
The line giving the exception is:
return command.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
Please advise.
Thanks,
Lars
Ps. The only write-operation that ever takes place against the table mentioned in the exception is the code below (pseudo code), and it only runs at once a day (at 5.30 am in the morning):
LOCK TABLES $Destination_Table WRITE
DROP TABLE IF EXISTS `$Destination_Table`
ALTER TABLE `$Source_Table` RENAME `$Destination_Table`
UNLOCK TABLES
Even if an application tried to read from the table at the same time as this happened, it should only result in a very brief delay (not an exception).