Hi,
I have an application running in production on Windows 2003 Server and
SQL Server 2000 (clustered). The app server is hosting my COM+ dll
which is being called by ASP 3 pages. Its an Intranet application.
What happens is: suddenly users get themselves out of the system and
unable to get back because it throws the error:
"Connection cannot be used to perform this operation. It is either
closed or Invalid in this context".
Now this error occurs when you try to use the database connection which
is closed. And if the connection is closed, even then it should not be
closed for all the users and even for new requests it should issue open
a connection if its closed.
Its not frequent error and happens twice this month in 15 days. The
only solution to this problem is going to COM+ Applications and
shutdown then Restart the dll. As its a production server so its not
easy to repeat the process.
I have reviewed the event logs and nothing suspisous has been found
except everytime first Secli Surity Policy applied event is found and
after that application stops bahaving in this fashion.
My dll is set as "Unattended Execution" and "Retained in Memory".
Any help would be highly appreciated.
Thanks,
adeel
Someone - 16 Sep 2005 18:10 GMT
Does the IIS server crashes or the SQL Server? What type and version of SQL
server do you use?
I am not sure if I could help you, but I once used the following free tool
to see what's crashing my IIS server:
http://www.iisfaq.com/Default.aspx?tabid=2513
One thing you could do is check if the connection was closed and reopen it,
but that doesn't fix the original problem. Sample code:
Public cn As ADODB.Connection
Public Sub MakeSureConnectionIsOpen()
If cn Is Nothing Then
Set cn = New ADODB.Connection
cn.Open ConStr
Else
If cn.State = adStateClosed Then ' adStateClosed = 0
cn.Open ConStr
End If
End If
End Sub
> Hi,
> I have an application running in production on Windows 2003 Server and
[quoted text clipped - 23 lines]
> Thanks,
> adeel
Tony Proctor - 16 Sep 2005 18:48 GMT
A few questions: are you using ADODB events? Are you using 'connection
pooling'? Is there a timeout on your connection objects?
Tony Proctor
> Hi,
> I have an application running in production on Windows 2003 Server and
[quoted text clipped - 23 lines]
> Thanks,
> adeel
Someone - 16 Sep 2005 20:42 GMT
More questions: What "Application protection" is set to in your web site
properties, Home Directory tab?
> Hi,
> I have an application running in production on Windows 2003 Server and
[quoted text clipped - 23 lines]
> Thanks,
> adeel
Adeel Ahmad - 18 Sep 2005 14:08 GMT
IIS works, I mean the ASP page tries to call the COM+ dll and returns
error
"Object Required" because it does'nt find the dll instance in memory.
SQL Server 2000 is hosted on Windows 2003 Server on a separate machine.
The Web Server is on Windows 2003 set under Integrated Windows
Authentication.
As per my understanding, if the dll goes down, any request call should
wake it up. But in this case we have to go and shutdown/Start the
application manually from Component Services.
I am using ADODB connection.Default timeout is being used for
connection object. Using connection string
"Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security
Info=False;Initial Catalog=" & strDB & ";Data Source=" & strServerName
& ""
The COM+ is configured as not to enforce Authorization check.
Someone just threw me the idea that it might be because of Transaction
not being clsoed properly but i have reviewed the code and its being on
every exit gate.
One problem is that i cant' debug on the server as its a production
server and its not happening on my development/UAT servers.
Regards,
Adeel
Paul Clement - 19 Sep 2005 15:03 GMT
¤ Hi,
¤ I have an application running in production on Windows 2003 Server and
¤ SQL Server 2000 (clustered). The app server is hosting my COM+ dll
¤ which is being called by ASP 3 pages. Its an Intranet application.
¤ What happens is: suddenly users get themselves out of the system and
¤ unable to get back because it throws the error:
¤ "Connection cannot be used to perform this operation. It is either
¤ closed or Invalid in this context".
¤
¤ Now this error occurs when you try to use the database connection which
¤ is closed. And if the connection is closed, even then it should not be
¤ closed for all the users and even for new requests it should issue open
¤ a connection if its closed.
¤
¤ Its not frequent error and happens twice this month in 15 days. The
¤ only solution to this problem is going to COM+ Applications and
¤ shutdown then Restart the dll. As its a production server so its not
¤ easy to repeat the process.
¤
¤ I have reviewed the event logs and nothing suspisous has been found
¤ except everytime first Secli Surity Policy applied event is found and
¤ after that application stops bahaving in this fashion.
¤
¤ My dll is set as "Unattended Execution" and "Retained in Memory".
¤ Any help would be highly appreciated.
Not exactly sure how you've configured your components but COM+ is stateless by default. You
shouldn't be attempting to persist connections (or other objects) if that is how your components are
coded. Connection pooling is automatic so your components should be opening connections as needed
and then closing them when finished so that they can be released to the connection pool.
COM+ components shutdown automatically after three minutes of idle time (unless you've changed this
option).
Paul
~~~~
Microsoft MVP (Visual Basic)
Adeel Ahmad - 20 Sep 2005 07:20 GMT
Here is what i have found from Event Long (App).
Event Type: Information
Event Source: VBRuntime
Event Category: None
Event ID: 1
Description:
The VB Application identified by the event source logged this
Application MyApplication: Thread ID: 208 ,Logged: MsgBox: , Run-time
error '3704':
Operation is not allowed when the object is closed.
Apparently this error coming from within "MyApplication". Means the ASP
page is able to call the dll method but its the dll which is throwing
the error.
I have not changed the default 3 minutes automatic shutdown time.
And my connections are being opened when required and closed as the
processing gets finished. Not really PERSISTING the connection.
The application was running fine since last 3 months or so, but
suddenly it has started giving the error.
Reviewed the code a dozen time. Any other action items to look for ?
Adeel
Someone - 20 Sep 2005 09:34 GMT
Not sure if you find this helpful...
http://support.microsoft.com/default.aspx?scid=kb;en-us;190410
http://groups.google.com/groups?as_q=vb+error+3704&num=100&scoring=r&hl=en
> Here is what i have found from Event Long (App).
> Event Type: Information
[quoted text clipped - 18 lines]
>
> Adeel