I have following code:
//...
using (TransactionScope tScope = new TransactionScope())
{
using (NpgsqlConnection myConnection = new NpgsqlConnection(_MyConnectionString))
{
try
{
myConnection.Open();
//...
tScope.Complete();
}
catch (Exception ex)
{
logger.Error(ex);
}
finally
{
myConnection.Close();
}
}
}
//...
The problem is, when some error occurred transactionscope do rollback, but, on the PostgreSQL server I have prepared transaction. And applications can not work anything with database server until I delet开发者_运维问答e prepared transaction manualy.
Any solution?
BTW, I use Npgsql version: 2.0.11.91
Best regards
精彩评论