• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 711
  • Last Modified:

Internal Connection Fatal Error Exception on calling Cancel on Asynchronous Call

I am using BeginExecuteNonQuery to call a long running stored procedure asynchronously. When the user wishes to cancel the operation I call the Cancel method .It works fine for the first time.Suppose user start the query again and cancels it the next time i get the following Exception System.InvalidOperationException: Internal Connection fatal error
0
shore-support
Asked:
shore-support
  • 5
  • 3
1 Solution
 
Richard LeeSoftware EnthusiastCommented:
Are you closing all the Connection or Transactions?

DaTribe
0
 
Richard LeeSoftware EnthusiastCommented:
I should have said Disposing of your Transactions.

DaTribe
0
 
shore-supportAuthor Commented:
I am taking care of clearing the transaction and connection in the Method that'll be invoked in the PostAsyncCall.When the transaction has passed through successfully i get the transaction object in this Method and commit it but when it is cancelled i see that the transaction object returned in this Method is null
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Richard LeeSoftware EnthusiastCommented:
Firstly a null object doesn't mean that what this object was referencing previously has been disposed. Yes the object is abandoned but garbage collection is non-deterministic. What I am getting at is as follows:

If in your BeginAsync you create a transaction and in your PostAsync you dispose of it, then if we replace the PostAsync with CancelAsync disposing of the transaction should still be done here before setting the transaction object to null.

DaTribe
0
 
shore-supportAuthor Commented:
When the user doesn't cancel the operation i get to see the Transaction Object in the IAsync Result which is passed to the Delegate and i commit the transaction and close the connection but when user Cancels i get null as the Transaction object in the same Delegate. I have even tried to use a global parameter for the Transaction and the Connection but i see even this Connection is closed in case of Cancel.
0
 
Richard LeeSoftware EnthusiastCommented:
Lets try again:

1. Is there an InnerException?
2. How is the transaction & connection being closed?
3. What is in the EventLog?
4. Implement some Debug.Trace to see what is happening.

DaTribe
0
 
shore-supportAuthor Commented:
Thanks. We are trying the above approach to resolve the issue.
0
 
Richard LeeSoftware EnthusiastCommented:
Any progress?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now