I have a function that will get a generic sql to do an operation on the database, after sending the command, I have in the log is information "ThreadAbortException", does anyone know how to work around this problem?
public static bool ExecutaComandoGenerico(string strQuery)
{
var connectionString = GetConnectionString();
using (OracleConnection connection = new OracleConnection(connectionString))
{
connection.Open();
OracleCommand command = connection.CreateCommand();
OracleTransaction transaction;
// Iniciar uma transação local
transaction = connection.BeginTransaction(IsolationLevel.ReadCommitted);
// Atribuir objeto de transação para uma transação local pendente
command.Transaction = transaction;
try
{
command.CommandText = strQuery;
command.ExecuteNonQuery();
transaction.Commit();
}
catch (Exception e)
{
transaction.Rollback();
}
}
return true;
}