开发者

can I use using(var scope = new TransactionScope()) with Postgres?

开发者 https://www.devze.com 2023-01-15 17:05 出处:网络
I\'m doing using(var scope = new TransactionScope()) { //lots of calls to sql server scope.Complete(); } and it works like a transaction

I'm doing

using(var scope = new TransactionScope())
{
//lots of calls to sql server
scope.Complete();
}

and it works like a transaction

I would like to know if it is goi开发者_如何学运维ng to work the same with postgres ?


TransactionScope eventually result in creation of concrete transaction object. In case of MS SQL it is SqlTransaction, in case of postgres it might be NpgsqlTransaction or whatever you are using. So if you doubt, you always can create transaction explicitly and be sure.

0

精彩评论

暂无评论...
验证码 换一张
取 消