Page 1 of 1

Transaction Doesn't working in Subsonic

PostPosted: Fri Oct 16, 2009 4:21 am
by dinhtd
* I have two tables

domain(id,code,name) branch(id,domain_id,address....) I using transaction to insert two tables concurrency. But when insert to second table failed I check my DB first table data still inserted.

* Here is my code:

using (var sharedConnectionScope = new SharedDbConnectionScope())

{
using (var ts = new TransactionScope())
{

Domain domain = getDomain();

Branch branch = getBranch();

domain.Save();

branch.DomainId = domain.Id;

branch.Save();

ts.Complete();
}
}

* Could anybody solve this problem for me? Thanks advanced

PostPosted: Fri Oct 16, 2009 11:57 am
by kdid
Are you sure you are in the right forum? This is the forum for Subsonic music streaming software.

PostPosted: Fri Oct 16, 2009 6:48 pm
by donpearson