G
Guest
I have an application that has been in production for some time. I have a
coworker who recently updated to windows 2003 sp1. When he runs the
application he gets an exception here:
Exception StackTrace:
at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction)
at
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
The exception SHOULD occur, because he isnt authorized for that SQL Server,
but what is troubling is that the exception should be handled. The code that
calls SqlConnection.Open() is wrapped in a try/catch block that catches all
sql exceptions. Still, we get the exception.
Now when he runs the application on my machine, which is windows 2003 server
without the service pack, it runs great. It only seems to occur on sp1. So, i
started to look into the issue and I noticed the assemblies had changed. So i
did an ILDASM and did a compare of the .il output and found the
SqlInternalConnection.UserCreateRequest() function had changed. Specifically,
it used to never throw an exception. Now it will throw an exception under
certain circumstances. This would be consistent with the exception that I am
now seeing in SP1 because ConnectionPool.GetConnection() calls this method.
Unfortunately, this is causing me issues.
What i really want to know is why my try/catch block isnt trapping the
exception. Instead its bubbling all the way up to
AppDomain.UnhandledException. I've seen this before with async callbacks and
threading, where if the exception is generated on a thread other than the one
that made the request it wont be transferred to the other thread, such as
getting an exception in a method called by ThreadPool.QueueUserWorkItem.
Does anyone have any ideas? Is this a known issue?
Thanks in advance.
coworker who recently updated to windows 2003 sp1. When he runs the
application he gets an exception here:
Exception StackTrace:
at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction)
at
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
The exception SHOULD occur, because he isnt authorized for that SQL Server,
but what is troubling is that the exception should be handled. The code that
calls SqlConnection.Open() is wrapped in a try/catch block that catches all
sql exceptions. Still, we get the exception.
Now when he runs the application on my machine, which is windows 2003 server
without the service pack, it runs great. It only seems to occur on sp1. So, i
started to look into the issue and I noticed the assemblies had changed. So i
did an ILDASM and did a compare of the .il output and found the
SqlInternalConnection.UserCreateRequest() function had changed. Specifically,
it used to never throw an exception. Now it will throw an exception under
certain circumstances. This would be consistent with the exception that I am
now seeing in SP1 because ConnectionPool.GetConnection() calls this method.
Unfortunately, this is causing me issues.
What i really want to know is why my try/catch block isnt trapping the
exception. Instead its bubbling all the way up to
AppDomain.UnhandledException. I've seen this before with async callbacks and
threading, where if the exception is generated on a thread other than the one
that made the request it wont be transferred to the other thread, such as
getting an exception in a method called by ThreadPool.QueueUserWorkItem.
Does anyone have any ideas? Is this a known issue?
Thanks in advance.