views:

64

answers:

0

I have not been able to get this working following the docs or other ideas people have tried.

If i use the below, there is no transactional behaviour at all. If i swap the shareddbscope with the transaction scope around, i dont get a save on a single record. if it call ts.complete at the bottom of the transaction i get a single record save working however errors when multiple records are saved with an sqlexception complaining about "pending requests working on this transaction". Can anyone help with my dilemma as i would quite like the agility of using subsonic, however cant live without the transactional behaviour.

        TransactionOptions op = new TransactionOptions();
        op.IsolationLevel = IsolationLevel.Serializable;
        using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required, op))
        {
        using (SharedDbConnectionScope sharedConnectionScope = new SharedDbConnectionScope())
        {
                        foreach (BILLDOC d in fd.Docs)
                            d.Save();