Error on opening db connection (MultiThread app)
Posted: Fri 03 May 2013 04:47
I start two threads, (linqconnect model), but it throws an exception "error on opening db connection"
No ex throws if i remove the two threads, and if I run one method after the other, but i want to optimize to reduce the time of the tasks trough the threads
Support LinqConnect multithreadding? Or i have to create another context or model?
mymethod()
{
_mainBackupGpsRawDataThread.Start();
_mainBackupGpsHistoricDataThread.Start();
}
code in thread1:
var total = MHistoryContext.Gpsrawdatas.Count(x => x.GpsLocalDate < toDateToBackup1);
...
code in thread2 (here throws ex) :
var total = MHistoryContext.Gpshistorics.Count(x => x.GpsLocalDate < toDateToBakup2);
...
Im using dotConnect for MySQL 7.6.226 (LinqConnect), VS2012.2, Win8x64
Thanks in advance!
No ex throws if i remove the two threads, and if I run one method after the other, but i want to optimize to reduce the time of the tasks trough the threads
Support LinqConnect multithreadding? Or i have to create another context or model?
mymethod()
{
_mainBackupGpsRawDataThread.Start();
_mainBackupGpsHistoricDataThread.Start();
}
code in thread1:
var total = MHistoryContext.Gpsrawdatas.Count(x => x.GpsLocalDate < toDateToBackup1);
...
code in thread2 (here throws ex) :
var total = MHistoryContext.Gpshistorics.Count(x => x.GpsLocalDate < toDateToBakup2);
...
Im using dotConnect for MySQL 7.6.226 (LinqConnect), VS2012.2, Win8x64
Thanks in advance!