we've a wcf service through which end user on iPad send orders. For long time, it is working with no error. From few days, we are receiving error via mail. My .net framework version is 4.6, EntityFramework version is 6.1.31219.0 & Devart.Data.MySql.Entity.EF6.dll version is 8.6.714.0.The error is coming from IEnumerable.Any Method. I know Entityframework automatically manage transaction in Save, Update & Delete operation. From Stack Trace, it seems IEnumerable.Any is maintaining transaction internally(calling ObjectContext.ExecuteInTransaction internally).The code is given bellow
Code: Select all
var device = _deviceRep.Get(Globals.CurrentDevice.UUID);
if(Globals.CurrentCompany.DomainName != "" && !device.CompanyDevices.Any(cd => cd.CompanyId == Globals.CurrentCompany.Id && cd.DeviceId == device.Id))
{
......
}
Exception Message:
An error occurred while closing the provider connection. See the inner exception for details.
Inner Exception Message:
This MySqlTransaction has completed; it is no longer usable.
Stack Trace:
at System.Data.Entity.Core.EntityClient.EntityConnection.StoreCloseHelper() at System.Data.Entity.Core.Objects.ObjectContext.ReleaseConnection() at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess) at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClassb.b__9() at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) at System.Data.Entity.Core.Objects.DataClasses.EntityCollection`1.Load(List`1 collection, MergeOption mergeOption) at System.Data.Entity.Core.Objects.DataClasses.RelatedEnd.DeferredLoad() at System.Data.Entity.Core.Objects.DataClasses.EntityCollection`1.GetEnumerator() at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate) at nVision.Office.Core.Modules.Device.WSDevice.VerifyDevice() in c:\nVision Office MVC\Codebase\nVision.WebService\Core\Modules\Company\Device\WSDevice.svc.cs:line 154 at nVision.WebService.Global.VerifyClientAccess(Boolean requireCompanyAuth, Boolean requireDeviceAuth) in c:\nVision Office MVC\Codebase\nVision.WebService\Global.asax.cs:line 325 at nVision.Office.Modules.Order.WSOrder.SaveOrder(Orderhead order) in c:\nVision Office MVC\Codebase\nVision.WebService\Modules\Order\WSOrder.svc.cs:line 527
Please let me know the possible cause for which it is happening. Need your help.
Best Regards
Sabbir