Transaction Doesn't working in Subsonic

Need help? Post your questions here.

Moderator: moderators

Transaction Doesn't working in Subsonic

Postby dinhtd » Fri Oct 16, 2009 4:21 am

* 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
dinhtd
 
Posts: 1
Joined: Fri Oct 16, 2009 4:18 am

Postby kdid » Fri Oct 16, 2009 11:57 am

Are you sure you are in the right forum? This is the forum for Subsonic music streaming software.
-- kdid
kdid
 
Posts: 131
Joined: Tue Jan 02, 2007 11:17 am

Postby donpearson » Fri Oct 16, 2009 6:48 pm

Facebook Group:
http://www.facebook.com/groups/subsonic.group/

Image
donpearson
 
Posts: 361
Joined: Wed Oct 15, 2008 3:53 pm
Location: UK


Return to Help

Who is online

Users browsing this forum: No registered users and 19 guests