Re: Microsoft Data Access Block and static methods

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Ravichandran J.V. (jvravichandran_at_yahoo.com)
Date: 12/17/04


Date: Fri, 17 Dec 2004 06:39:45 -0800


"If User A calls my web service at the same time User B calls it, isn't
it possible that B might get A's result, or vice versa?"

You could set EnableSessionState to true in the WebMethod atribute so
that the webservice could maintain the state for the client until the
method completes its execution. Anyway, it is not just session state
that is important when using a webservice as a Data Access Layer, it is
also the TransactionContext. More on transactions in Web Services upon
your reply.

"Any public static (Shared in Visual Basic) members of this type are afe
for multithreaded operations. Any instance members are not guaranteed to
be thread safe."

"I would figure it to be completely opposite - that if multiple threads
are hitting a static member, it'd be possible those results could get
returned to the wrong user, whereas in an instance member, each method
being called is a separate logical piece, so there's no results being
misguided."

It is not the opposite, though, you would need to lock the application
state, if you are talking about the ASP.Net environment (and if you are
not, I am), before writing or accessing a static member.

with regards,

J.V.Ravichandran
- http://www.geocities.com/
  jvravichandran
- http://www.411asp.net/func/search?
  qry=Ravichandran+J.V.&cob=aspnetpro
- http://www.southasianoutlook.com
- http://www.MSDNAA.Net
- http://www.csharphelp.com
- http://www.poetry.com/Publications/
  display.asp?ID=P3966388&BN=999&PN=2
- Or, just search on "J.V.Ravichandran"
  at http://www.Google.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Relevant Pages

  • Re: Help understanding sessions in Web service w/ legacy VB6 event handling
    ... I have a single Web service class which makes calls into ... The receiving event handlers are implemented as private members of the ... ArrayList declared as a member of the Web service class. ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: EnumChildWindows and C++
    ... I have a good stack of reading material now. ... Generally a *public* static member function can be used ... > whereever a C-style non-member function can be used. ...
    (microsoft.public.win32.programmer.ui)
  • Re: Creating thread from a class object
    ... and non-static member functions and data of any instance of the ... forth having that type and use all the private members. ... << o) using only the public interface, the fact is that static member ...
    (microsoft.public.vc.language)
  • Re: OK to air-nail 2x4s together on their flat faces?
    ... straight member is to eyeball them and then lay them so the curve is ...  Start nailing at one end and keep pulling the opposite ... nailing point. ...
    (alt.home.repair)
  • Re: Whats wrong withthe code?
    ... Rob Williscroft wrote: ... >>Can you really have a static member that is the same type as the class ... but seems strange to me. ...
    (comp.lang.cpp)