I cannot imagine it not being the case but I’ll ask it anyway:
Is the connection manager thread safe?
I ask this because I get a ‘transaction still active’ exception.
What could be the causes of this error?
AFAIK: I only use a particular dataAdapter in one thread and I do not use async functions (being: ToDABindingList and ApplyUpdates)
for example:
using (LinqLocalDataAdapter dataAdapter = CloudServerUtil.prepareSyncMasterLocalLinqAdapter())
{
...
var runinfoQuery = from c in dataAdapter.GetTable<OffCloudServerData.SyncMasterDAClasses.SyncRunInfo>() select c;
var runinfolist = runinfoQuery.ToDABindingList(); // This does the SQL SELECT
...
runinfo = new OffCloudServerData.SyncMasterDAClasses.SyncRunInfo();
...
runinfolist.Add(runinfo);
...
dataAdapter.ApplyChanges();
...
}
Exception: Cannot release connection because its transaction is still active [Source:RemObjects.DataAbstract.Server]
at RemObjects.DataAbstract.Server.ConnectionManager.ReleaseConnection(IAbstractConnection connection, Boolean keepInPool)
at RemObjects.DataAbstract.Server.DataAbstractService.InternalReleaseConnection(IAbstractConnection connection, Boolean keepInPool)
at RemObjects.DataAbstract.Server.DataAbstractService.BeginTransaction(IAbstractConnection& connection)
at RemObjects.DataAbstract.Server.DataAbstractService.GetDataViaDASql(String tableName, TableRequestInfoV6 requestInfo, DataStreamer streamer, Boolean allowPrivateAccess)
at RemObjects.DataAbstract.Server.DataAbstractService.InternalGetData(String[] tableNames, TableRequestInfo[] requestInfo, DataStreamer streamer, Boolean allowPrivateAccess)
at RemObjects.DataAbstract.Server.DataAbstractService.LocalGetData(String[] tableNames, TableRequestInfo[] requestInfo, DataStreamer streamer)
at RemObjects.DataAbstract.Linq.LinqLocalDataAdapter.FetchData(TableRequestInfo[] requests, String[] names, Action`3 fillMethod)
at RemObjects.DataAbstract.Linq.RemoteTable`1.Execute(Expression expression, DataParameter[] parameters)
at RemObjects.DataAbstract.Linq.RemoteTableQuery`1.GetEnumerable()
at RemObjects.DataAbstract.Linq.BindingListExtensions.ToDABindingList[T](IEnumerable`1 data)
at SyncMaster.Logic.SyncScheduler.processSchedule()