Results 1 to 3 of 3

Thread: [2005] should i dispose connection in web services ?

  1. #1

    Thread Starter
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    [2005] should i dispose connection in web services ?

    dear all,

    i know the difference between close and dispose, close returns the connection to the pool and dispose cleans out its unmanaged resources and drops it out of pool ( kill it).

    in web services , i think there is no pools.
    because each call to a web service runs as a separate application right ??

    as a result there is no pool of connections to return back to when the web service is done working.

    so in your opinion should i dispose the connection in web services after closing them as the server will handle tons of requests ( this is a heavy traffic service ? ???? )

    thx in advance for all

  2. #2
    PowerPoster VBDT's Avatar
    Join Date
    Sep 2005
    Location
    CA - USA
    Posts
    2,922

    Re: [2005] should i dispose connection in web services ?

    Disposing an object and closing a connection, are different things! if you created connection object let say "myConn" and you make connection then when you close the connection the object is still available for another connection! but if you dispose the object than it will disconnect the object and dispose it (Note "myConn" variable points to Nothing) so you can't use the object any more but to create a new object. Saying that, I don't think you need to dispose the object after closing it. There is no reason to dispose and create the object for any connection or disconnection, just use the same object. dispose the object if you don't need it any more (when you close the app).

  3. #3

    Thread Starter
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    Re: [2005] should i dispose connection in web services ?

    dispose the object if you don't need it any more (when you close the app)
    then my idea is right. i should dispose the connection in the end of webservice call. because i will never use it again.

    thank you for your help and i am still willing to hear other opinions.

    rgds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width