locked
SqlConnection does not support parallel transactions. RRS feed

  • Question

  • at dbserversyncprovider I could able to enumerate the changes and when at applying changes at clientsyncprovider I get the error"SqlConnection does not support parallel transactions.".
    for reference:

     

    public class SQLExpressClientSyncProvider:ClientSyncProvider

    {

    private DbServerSyncProvider _dbSyncProvider;
    private Guid _clientId;

    public

     

    override SyncContext ApplyChanges(SyncGroupMetadata groupMetadata, System.Data.DataSet dataSet, SyncSession syncSession)

    {

     

    SyncContext syncContext = _dbSyncProvider.ApplyChanges(groupMetadata, dataSet, syncSession);

     

    foreach (SyncTableMetadata table in groupMetadata.TablesMetadata)

    {

    SetTableReceivedAnchor(table.TableName, groupMetadata.NewAnchor);

    }

     

    return syncContext;

    }

     



     


    Thanks, Bharathi
    • Moved by Max Wang_1983 Thursday, April 21, 2011 10:29 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Friday, November 20, 2009 10:15 AM

Answers

  • I would recommend you to use the new sqlsyncprovider.
    For samples, maybe here is what you can do: (I just posted this in another thread)

    Please start with the overview here.
    Then use the sample - C:\Program Files (x86)\Microsoft SDKs\Microsoft Sync Framework\2.0\Samples\SharingAppDemo-CEProviderEndToEnd - that comes with the SDK. However the sample syncs between SQL Server to Compact client. However the pattern of usage is not very different.
    This posting is provided AS IS with no warranties, and confers no rights
    Tuesday, December 1, 2009 1:07 AM

All replies

  • The exception means the is trying 2 or more simultaneous transactions on single SqlConnection. There can be lots of possiblities for this. Make sure your code is thread safe and you are not reusing transactions.

    I would recommend you to  move to SqlSyncProvider for your scenario

    thanks
    Jandeep
    jandeepc
    Saturday, November 21, 2009 12:20 AM
  • The exception means the is trying 2 or more simultaneous transactions on single SqlConnection. There can be lots of possiblities for this. Make sure your code is thread safe and you are not reusing transactions.

    I would recommend you to  move to SqlSyncProvider for your scenario

    thanks
    Jandeep
    jandeepc
    jandeep,

    what are the other important possibilities?
    i am using the sqlexpresscliensyncprovider class provided by microsoft.

    It is working fine for uploadonly sync.for downloadonly sync I am getting the exception.
    also the same code was working fine in past. after adding some few tables I am getting the exception.
    please let me know if you want more details.

    Thanks, Bharathi
    Wednesday, November 25, 2009 7:00 AM
  • Bharathi,

    As posted in the other thread, I highly encourage you to please use the SqlSyncProvider that ship as part of Microsoft Sync Framework 2.0 Database providers (SDK and redists) as the Server and client providers. The previously posted express client was just a sample that was not complete in its feature set, was posted as a stop gap solution. The recently shipped provider that I mention above has been tested to run fine against the express clients and supports conflicts and is a supported version of the provider.

    Mahesh
    This posting is provided AS IS with no warranties, and confers no rights
    Saturday, November 28, 2009 5:38 AM
  • Bharathi,

    As posted in the other thread, I highly encourage you to please use the SqlSyncProvider that ship as part of Microsoft Sync Framework 2.0 Database providers (SDK and redists) as the Server and client providers. The previously posted express client was just a sample that was not complete in its feature set, was posted as a stop gap solution. The recently shipped provider that I mention above has been tested to run fine against the express clients and supports conflicts and is a supported version of the provider.

    Mahesh
    This posting is provided AS IS with no warranties, and confers no rights

    I am in half way of coding.should I change my existing classes(clientsyncprovider and serversyncprovider) to sqlsyncprovider?
     is there any example for SqlSyncProvider?
    Thanks, Bharathi
    Monday, November 30, 2009 9:36 AM
  • I would recommend you to use the new sqlsyncprovider.
    For samples, maybe here is what you can do: (I just posted this in another thread)

    Please start with the overview here.
    Then use the sample - C:\Program Files (x86)\Microsoft SDKs\Microsoft Sync Framework\2.0\Samples\SharingAppDemo-CEProviderEndToEnd - that comes with the SDK. However the sample syncs between SQL Server to Compact client. However the pattern of usage is not very different.
    This posting is provided AS IS with no warranties, and confers no rights
    Tuesday, December 1, 2009 1:07 AM