axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "nadir amra (JIRA)" <>
Subject [jira] Closed: (AXISCPP-1021) Connections not being closed - resulting in unused connections over time
Date Tue, 20 Feb 2007 05:39:06 GMT


nadir amra closed AXISCPP-1021.

       Resolution: Fixed
    Fix Version/s: current (nightly)

Resolved. Nothing is easy :-)

The soap transport interface was changed:

      * @brief Closes the connection established with OpenConnection.
+     * @param forceClose whether or not to force a close. If true, 
+     *        the connection will be closed.  If false, the transport
+     *        will determine whether connection should be closed based
+     *        on transport dependent properties.  For example, 
+     *        HTTP transport may use HTTP header "Connection: close"
+     *        to determine if connection should be closed.
      * @example AxisTransport.h
-    virtual void closeConnection()=0;
+    virtual void closeConnection(bool forceClose=true)=0;

The HTTPTransport's closeConnection now has close logic:

 void HTTPTransport::
+closeConnection(bool forceClose)

+    // We will close the connection if forced close, or if "Connection: close" 
+    // header was detected.
+    if (forceClose || m_bReopenConnection)
+    {
+        m_bReopenConnection = false;
+        m_pActiveChannel->close();
+    }

If you want to ensure that connections are closed on each invocation, then one can invoke
stub method setTransportProperty.  For example:

ws.setTransportProperty("Connection", "close");

This will ensure that when web service method has completed, the call to Call::unInitialize()
will call the transport's closeConnection method which will see that the property has been
set and close the connection.  

Since the transport's closeConnection method now actually has the logic to close connections,
it will do so if it needs to or if a force close was issued, which is a new method on the
Call class, closeTransportConnection()...which does a forced close on the active channel.
 Note that Call::unInitialize does not do a forced close, it leaves it up to closeConnection()
to determine whether to close connection or not.  This is the default. 

I also updated ConnectionClose unit test to test setting the transport property.  

Things look good. 

> Connections not being closed - resulting in unused connections over time
> ------------------------------------------------------------------------
>                 Key: AXISCPP-1021
>                 URL:
>             Project: Axis-C++
>          Issue Type: Bug
>          Components: Transport (axis3)
>            Reporter: nadir amra
>         Assigned To: nadir amra
>             Fix For: current (nightly)
> Axis not fully closing connections after successful WS call (increase in number of unused
connections over time).

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message