I´m having problems when I try to use the .NET 2.0 TransactionScope and SQL Server 2005, the code works fine using the SQL 2000, but when I try to use the SQL SERVER 2005 it doesn't work, and I don't know what to do.
The Error that occurs is :
"Error HRESULT E_FAIL has been returned from a call to a COM component."
And that´s a code example:
using(TransactionScope scope = new TransactionScope())
{
try
{
ISession sessao = NHibernateHelper.Fabrica.OpenSession();
sessao.Save(entidade);
sessao.Flush();
sessao.Close();
sessao = NHibernateHelper.Fabrica.OpenSession();
sessao.Save(entidade2);
sessao.Flush();
sessao.Close();
scope.Complete();
}
catch(Exception)
{
return;
}
}
|