You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2005/04/21 01:55:18 UTC

cvs commit: ws-axis/java/src/org/apache/axis/client Service.java

dims        2005/04/20 16:55:18

  Modified:    java/src/org/apache/axis/transport/http AxisServlet.java
               java/src/org/apache/axis/client Service.java
  Log:
  Fix for AXIS-1754 - Service ThreadLocal previousCall should not be static
  
  Revision  Changes    Path
  1.189     +0 -3      ws-axis/java/src/org/apache/axis/transport/http/AxisServlet.java
  
  Index: AxisServlet.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/transport/http/AxisServlet.java,v
  retrieving revision 1.188
  retrieving revision 1.189
  diff -u -r1.188 -r1.189
  --- AxisServlet.java	18 Apr 2005 17:08:02 -0000	1.188
  +++ AxisServlet.java	20 Apr 2005 23:55:18 -0000	1.189
  @@ -772,9 +772,6 @@
               res.setStatus(202);
           }
           
  -        // reset last Call object associated with the current thread
  -        Service.clearCall();
  -        
           if (isDebug) {
               log.debug("Response sent.");
               log.debug("Exit: doPost()");
  
  
  
  1.107     +4 -19     ws-axis/java/src/org/apache/axis/client/Service.java
  
  Index: Service.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/client/Service.java,v
  retrieving revision 1.106
  retrieving revision 1.107
  diff -u -r1.106 -r1.107
  --- Service.java	24 Feb 2005 21:59:54 -0000	1.106
  +++ Service.java	20 Apr 2005 23:55:18 -0000	1.107
  @@ -82,7 +82,7 @@
       /**
        * Thread local storage used for storing the last call object
        */
  -    private static ThreadLocal previousCall = new ThreadLocal();
  +    private static Call previousCall = null;
       private static HashMap cachedWSDL = new HashMap();
       private static boolean cachingWSDL = true;
   
  @@ -546,7 +546,7 @@
        */
       public javax.xml.rpc.Call createCall() throws ServiceException {
           Call call = new org.apache.axis.client.Call(this);
  -        previousCall.set(call);
  +        previousCall = call;
           return call;
       }
   
  @@ -829,25 +829,10 @@
   
       /**
        * Returns last Call object associated with 
  -     * the current thread.
  +     * this service.
        */
       public Call getCall() throws ServiceException {
  -        Call call = (Call) previousCall.get();
  -        return call;
  -    }
  -
  -    /* Storing the last Call object on thread local storage leads to
  -     * keeping references to objects longer then necessary. Especially
  -     * in server environment with thread pools. This function helps to 
  -     * reset the object associated with the thread. This should be called
  -     * when the thread is done serving the request. 
  -     */
  -    /**
  -     * Resets the Call object associated with
  -     * the current thread.
  -     */
  -    public static void clearCall() {
  -        previousCall.set(null);
  +        return previousCall;
       }
   
       /**