P
pers
Hi all
In my web application I have following code:
SqlConnection con = new SqlConnection("Data Source=.;Connect Timeout=15;
Initial Catalog=SaamicAcc1;Integrated Security=True");
SqlCommand com = new SqlCommand("",con);
com.Parameters.AddWithValue("@A", "somevalue");
com.CommandText = "Insert into Test (Name) values (@A)";
con.Open();
com.Transaction= con.BeginTransaction();
com.ExecuteNonQuery();
Session["con"] = com.Transaction;
Response.Redirect("default5.aspx");
and in default5.aspx I commit or rollback this transaction.
The problem is If Session expired or the page unexpectedly closed the
SqlTransaction stays in pending state.
How can I set for example a timeout for transaction or transaction
automatic closed??
thanks in advance
In my web application I have following code:
SqlConnection con = new SqlConnection("Data Source=.;Connect Timeout=15;
Initial Catalog=SaamicAcc1;Integrated Security=True");
SqlCommand com = new SqlCommand("",con);
com.Parameters.AddWithValue("@A", "somevalue");
com.CommandText = "Insert into Test (Name) values (@A)";
con.Open();
com.Transaction= con.BeginTransaction();
com.ExecuteNonQuery();
Session["con"] = com.Transaction;
Response.Redirect("default5.aspx");
and in default5.aspx I commit or rollback this transaction.
The problem is If Session expired or the page unexpectedly closed the
SqlTransaction stays in pending state.
How can I set for example a timeout for transaction or transaction
automatic closed??
thanks in advance