sqlconnection does not support parallel transaction
-
24 พฤศจิกายน 2552 7:23
refer:http://social.microsoft.com/Forums/en-US/uklaunch2007ado.net/thread/9a32241c-790b-4be7-8230-07deef9ad798?prof=requiredI could not still able to identify the problem.when I get applychanges() at client immediately end transaction calls and in the bool variable commit i get false and the exception occurs_<pre lang="x-c#"> public class SQLExpressClientSyncProvider:ClientSyncProvider { private DbServerSyncProvider _dbSyncProvider; private Guid _clientId; private int _refCntSession; private IDbTransaction _transaction; private const string GuidTableName = "guid"; private const string AnchorTableName = "anchor"; public event EventHandler<ApplyChangeFailedEventArgs> ApplyChangeFailed; public SQLExpressClientSyncProvider() { _dbSyncProvider = new DbServerSyncProvider(); _refCntSession = 0; _transaction = null; }
<pre lang="x-c#"> public override void BeginTransaction(SyncSession syncSession) { _refCntSession++; if (Connection.State == ConnectionState.Closed) { Connection.Open(); } if (_transaction == null) { _transaction = _dbSyncProvider.Connection.BeginTransaction(); } }
<pre lang="x-c#"> public override void EndTransaction(bool commit, SyncSession syncSession) { _refCntSession--; if (_refCntSession == 0) { if (commit) _transaction.Commit(); else _transaction.Rollback(); _transaction.Dispose(); _transaction = null; Connection.Close(); } if (_refCntSession < 0) _refCntSession = 0; //else if (_refCntSession < 0) // throw new SyncException("Transaction error: _refCntSession < 0"); }
Thanks, Bharathi- ย้ายโดย Max Wang_Chinasoft 21 เมษายน 2554 22:30 forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
ตอบทั้งหมด
-
28 พฤศจิกายน 2552 5:40เจ้าของ
I think there is another thread from you in this forums that is tracking the same issue. We should probably use that to track further.
This posting is provided AS IS with no warranties, and confers no rights- เสนอเป็นคำตอบโดย Mahesh DudgikarMicrosoft, Owner 2 ธันวาคม 2552 6:53
- ทำเครื่องหมายเป็นคำตอบโดย Mahesh DudgikarMicrosoft, Owner 4 ธันวาคม 2552 7:13