I use Entity Developer create the class.
I found that if include field with type 'Date' or 'DateTime'
ChangeConflictException catch in DC.SubmitChanges();
( just change record.)
( insert new record is ok.)
Type 'Time' is ok.
Server is MySQL server version 4.1.7-nt
and, my system language is Chinese.
now, i change to varchar for datetime.
ChangeConflictException <- type 'Date' or 'DateTime'
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
Could you please specify the following:
- the version of dotConnect for MySQL you are using;
- the message and stack trace of the exception you are receiving;
- the definition of the table with which the problem occurs.
If possible, please send us a model or a complete test project with which the issue can be reproduced. We couldn't reproduce it in our environment with the latest 6.0.58 version of dotConnect for MySQL.
- the version of dotConnect for MySQL you are using;
- the message and stack trace of the exception you are receiving;
- the definition of the table with which the problem occurs.
If possible, please send us a model or a complete test project with which the issue can be reproduced. We couldn't reproduce it in our environment with the latest 6.0.58 version of dotConnect for MySQL.
Maybe only in old version.
I install MySQL Database in my development computer(5.1.52-community)
and run program in local is ok.
Only found when connect to server(4.1.7-nt)
Devart.Data.dll 5.0.159.0
Devart.Data.MySql.dll 6.0.58.0
I test with these code...
using LinkerContext;
namespace test
{
class Program
{
static void Main(string[] args)
{
//LinkerDataContext DC = new LinkerDataContext(@"User Id=root;Password=lim;Host=127.0.0.1;Database=tpoker;");//ok
LinkerDataContext DC = new LinkerDataContext();//error
foreach (var item in DC.Paysys_machines)
{
item.IsOnLine = !item.IsOnLine;//just for test
}
DC.SubmitChanges();//error here
}
}
}
error:
Devart.Data.Linq.ChangeConflictException was unhandled
Message="Row not found or changed."
Source="Devart.Data.Linq"
StackTrace:
於 Devart.Data.Linq.y.a(DataContext A_0, ConflictMode A_1)
於 Devart.Data.Linq.y.b(DataContext A_0, ConflictMode A_1)
於 Devart.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode)
於 Devart.Data.Linq.DataContext.SubmitChanges()
於 test.Program.Main(String[] args) 於 test\Program.cs: 行 21
於 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
於 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
於 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
於 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
於 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
於 System.Threading.ThreadHelper.ThreadStart()
InnerException:
Table:
# Database: tpoker
# Table: 'paysys_machine'
#
CREATE TABLE `paysys_machine` (
`id` int(10) unsigned NOT NULL auto_increment,
`LocID` int(10) unsigned NOT NULL default '0',
`IP` varchar(20) NOT NULL default '0000',
`MAC` varchar(20) NOT NULL default '00-00-00-00-00-00',
`Game` varchar(100) NOT NULL default '',
`isOnLine` tinyint(1) NOT NULL default '0',
`isWarning` tinyint(1) NOT NULL default '0',
`isLocked` tinyint(1) NOT NULL default '0',
`CurrentCredits` int(10) unsigned NOT NULL default '0',
`TodayIn` int(10) unsigned NOT NULL default '0',
`TodayOut` int(10) unsigned NOT NULL default '0',
`isError` tinyint(1) NOT NULL default '0',
`Error_code` int(11) NOT NULL default '0',
`LastOn` datetime default '0000-00-00 00:00:00',
`LastOff` datetime default '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
I install MySQL Database in my development computer(5.1.52-community)
and run program in local is ok.
Only found when connect to server(4.1.7-nt)
Devart.Data.dll 5.0.159.0
Devart.Data.MySql.dll 6.0.58.0
I test with these code...
using LinkerContext;
namespace test
{
class Program
{
static void Main(string[] args)
{
//LinkerDataContext DC = new LinkerDataContext(@"User Id=root;Password=lim;Host=127.0.0.1;Database=tpoker;");//ok
LinkerDataContext DC = new LinkerDataContext();//error
foreach (var item in DC.Paysys_machines)
{
item.IsOnLine = !item.IsOnLine;//just for test
}
DC.SubmitChanges();//error here
}
}
}
error:
Devart.Data.Linq.ChangeConflictException was unhandled
Message="Row not found or changed."
Source="Devart.Data.Linq"
StackTrace:
於 Devart.Data.Linq.y.a(DataContext A_0, ConflictMode A_1)
於 Devart.Data.Linq.y.b(DataContext A_0, ConflictMode A_1)
於 Devart.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode)
於 Devart.Data.Linq.DataContext.SubmitChanges()
於 test.Program.Main(String[] args) 於 test\Program.cs: 行 21
於 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
於 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
於 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
於 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
於 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
於 System.Threading.ThreadHelper.ThreadStart()
InnerException:
Table:
# Database: tpoker
# Table: 'paysys_machine'
#
CREATE TABLE `paysys_machine` (
`id` int(10) unsigned NOT NULL auto_increment,
`LocID` int(10) unsigned NOT NULL default '0',
`IP` varchar(20) NOT NULL default '0000',
`MAC` varchar(20) NOT NULL default '00-00-00-00-00-00',
`Game` varchar(100) NOT NULL default '',
`isOnLine` tinyint(1) NOT NULL default '0',
`isWarning` tinyint(1) NOT NULL default '0',
`isLocked` tinyint(1) NOT NULL default '0',
`CurrentCredits` int(10) unsigned NOT NULL default '0',
`TodayIn` int(10) unsigned NOT NULL default '0',
`TodayOut` int(10) unsigned NOT NULL default '0',
`isError` tinyint(1) NOT NULL default '0',
`Error_code` int(11) NOT NULL default '0',
`LastOn` datetime default '0000-00-00 00:00:00',
`LastOff` datetime default '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
Could you please specify the SQL command that is generated for this update? You can check it with the LinqMonitor component and dbMonitor application; for the details on how to use them, please refer to
http://www.devart.com/linqconnect/docs/LinqMonitor.html
http://www.devart.com/linqconnect/docs/dbMonitor.html
Also, please specify the data from the row with which the issue occurs. We couldn't reproduce the problem in our environment.
http://www.devart.com/linqconnect/docs/LinqMonitor.html
http://www.devart.com/linqconnect/docs/dbMonitor.html
Also, please specify the data from the row with which the issue occurs. We couldn't reproduce the problem in our environment.