| View previous topic :: View next topic |
| Author |
Message |
ngoodwin
Joined: 29 Jul 2009 Posts: 9
|
Posted: Mon 11 Jan 2010 17:12 Post subject: MySQL dotConnect Lockup/Infinite loop |
|
|
The following code sample creates what seems to be a recursive infinite loop. I suspect that when the connection exception occurs, it tries to close the connection and thus will tries to commit the open transaction, which fails and tries to close the connection, etc.
This happens on version 5.40.44.0. Can you please check if this is fixed in the current newest version? If so i will simply upgrade, however I'd like to avoid the upgrade process if the current version is fixed and just simply wait till a version with this bug fixed is released. Thank you.
| Code: |
/// <summary>
/// Reproduce locked table bug for DevART MySQL
/// </summary>
private void BugRepro()
{
try
{
var connectionStringBuilder = new MySqlConnectionStringBuilder
{
Host = "*",
UserId = "*",
Password = "*"
};
string cs = connectionStringBuilder.ToString();
string dataBaseName = "devartBugRepro";
string tableName = "testTable";
string setupSchema = "CREATE DATABASE `" + dataBaseName
+
@"`;
CREATE TABLE `"
+ dataBaseName + "`.`" + tableName
+
@"` (
`Id` int(11) NOT NULL auto_increment,
`Name` varchar(45) default NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB;";
string dropSchema = "DROP DATABASE `" + dataBaseName + "`";
using (var mysqlConn = new MySqlConnection(cs))
{
mysqlConn.Open();
using (MySqlCommand cmd = mysqlConn.CreateCommand())
{
cmd.CommandText = setupSchema;
cmd.ExecuteNonQuery();
var endSignal = new ManualResetEvent(false);
var readySignal = new ManualResetEvent(false);
var lockThread =
new Thread(
x =>
this.LockDB(endSignal,
readySignal,
cs,
dataBaseName,
tableName));
lockThread.Start();
readySignal.WaitOne(); // Wait for thread to signal us to go.
cmd.CommandText = "USE " + dataBaseName;
cmd.ExecuteNonQuery();
using (var itx = mysqlConn.BeginTransaction())
{
using (var transCmd = mysqlConn.CreateCommand())
{
transCmd.Transaction = itx;
transCmd.CommandText = "INSERT INTO `" + tableName
+
"` (`Id`, `Name`) VALUES (NULL, \"Nick\");";
transCmd.ExecuteNonQuery();
itx.Commit();
}
}
endSignal.Set();
cmd.CommandText = dropSchema;
cmd.ExecuteNonQuery();
}
}
}
catch (Exception ex)
{
Console.WriteLine("Exception in BugRepro: " + ex);
}
}
/// <summary>
/// Locks the DB.
/// </summary>
/// <param name="endSignal">
/// The <see cref="ManualResetEvent"/> to end this thread.
/// </param>
/// <param name="readySignal">
/// Signal we have locked the table and are finished.
/// </param>
/// <param name="connectionString">
/// The connection string.
/// </param>
/// <param name="dataBaseName">
/// Name of the database.
/// </param>
/// <param name="tableName">
/// Name of the table.
/// </param>
private void LockDB(WaitHandle endSignal,
WaitHandle readySignal,
string connectionString,
string dataBaseName,
string tableName)
{
try
{
using (var mysqlConn = new MySqlConnection(connectionString))
{
mysqlConn.Open();
using (MySqlCommand cmd = mysqlConn.CreateCommand())
{
cmd.CommandText = "USE " + dataBaseName;
cmd.ExecuteNonQuery();
cmd.CommandText = "LOCK TABLE " + tableName + " WRITE";
cmd.ExecuteNonQuery();
WaitHandle.SignalAndWait(readySignal, endSignal);
}
}
}
catch (Exception ex)
{
Console.WriteLine("Exception in LockDB Thread: " + ex);
}
}
|
|
|
| Back to top |
|
 |
ngoodwin
Joined: 29 Jul 2009 Posts: 9
|
Posted: Tue 12 Jan 2010 13:47 Post subject: Reproducible in latest version |
|
|
| I have just used the same code sample as above to reproduce this bug in MySql DotConnection version 5.50.62.0. I really need a response soon, this bug is critical. I can't see a way to work around this without this problem being resolved. |
|
| Back to top |
|
 |
ngoodwin
Joined: 29 Jul 2009 Posts: 9
|
Posted: Wed 13 Jan 2010 19:53 Post subject: |
|
|
| I'd really like a reply here. I emailed you guys too and have not heard anything back. Would love to know if this will be fixed or not. This is a huge issue. |
|
| Back to top |
|
 |
Shalex Devart Team
Joined: 14 Aug 2008 Posts: 1920
|
Posted: Mon 18 Jan 2010 10:44 Post subject: |
|
|
| We are investigating the issue. We will notify you about the results as soon as possible. |
|
| Back to top |
|
 |
ngoodwin
Joined: 29 Jul 2009 Posts: 9
|
Posted: Tue 19 Jan 2010 15:32 Post subject: |
|
|
| Do you guys have a timeframe? This is causing a critical issue here and we are really interested in a fix. |
|
| Back to top |
|
 |
StanislavK Devart Team
Joined: 03 Dec 2009 Posts: 554
|
Posted: Wed 20 Jan 2010 14:00 Post subject: |
|
|
We have fixed the issue. The fix will be available in the nearest build. We plan to release it in the end of the month.
To receive the build before it is released, please contact us:
http://www.devart.com/company/contact.html
If you have an active license, please specify its number. Otherwise, we can send you the trial edition. |
|
| Back to top |
|
 |
ngoodwin
Joined: 29 Jul 2009 Posts: 9
|
Posted: Wed 03 Feb 2010 19:13 Post subject: |
|
|
| Any update on the release of this? |
|
| Back to top |
|
 |
Shalex Devart Team
Joined: 14 Aug 2008 Posts: 1920
|
Posted: Thu 04 Feb 2010 10:35 Post subject: |
|
|
| We plan to make a new build next week. |
|
| Back to top |
|
 |
StanislavK Devart Team
Joined: 03 Dec 2009 Posts: 554
|
|
| Back to top |
|
 |
ngoodwin
Joined: 29 Jul 2009 Posts: 9
|
Posted: Tue 09 Feb 2010 17:07 Post subject: |
|
|
| Any idea when this will be released non-beta? We do not want to put the beta inside of our production release. |
|
| Back to top |
|
 |
StanislavK Devart Team
Joined: 03 Dec 2009 Posts: 554
|
Posted: Tue 09 Feb 2010 17:22 Post subject: |
|
|
| The build is called Beta because it includes major changes intended to support Entity Framework v4 Beta 2. These changes mostly concern the Devart Entity Developer application. dotConnect for MySQL itself is stable. |
|
| Back to top |
|
 |
|