The root transaction wanted to commit, but transaction aborted

The root transaction wanted to commit, but transaction aborted

Post by Grobe » Tue, 25 Nov 2003 18:44:03


I have a COM+ class with the attribute
[Transaction(TransactionOption.Required)] in which I have a function with
the AutoComplete attribute. The function runs a stored procedure with a
batch job that takes about 10 minutes. However, when execution returns to
the frunction that called the batch function the following error is raised:
"The root transaction wanted to commit, but transaction aborted" and the
batch is rolled back. This doesn't happen when I test the function with a
short SP (less then a minute or something). As you can see in the code below
I set the command timeout to 1000, which is more than enought, but there
seems to be another timeout raised somewhere. Anyone knows what the problem
is?

==== Code snippet ===========================

[AutoComplete]
public DataSet RunSP(string SP, string conString)
{
try
{
// Create connection
SqlConnection con = new SqlConnection(conString);
try
{
// Create command
SqlCommand com = new SqlCommand(SP, con);
com.CommandType = CommandType.StoredProcedure;
com.CommandTimeout = 1000;

// Create adapter
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = com;

// Connect
con.Open();

// Create dataset and fill it
DataSet ds = new DataSet();
da.Fill(ds);
return ds;
}
catch(Exception)
{
throw;
}
finally
{
con.Close();
}
}
catch (Exception)
{
throw;
}
}
=== End of code snippet ========================
Regards
/Grober
 
 
 

The root transaction wanted to commit, but transaction aborted

Post by Grobe » Tue, 25 Nov 2003 23:55:18

No, unfortunately it didn't help. Still same problem. Anyone?

/Grober