Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using VFP com components from ASP pages
Message
 
 
À
25/09/2000 23:35:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00420749
Message ID:
00420812
Vues:
29
AFAIK, you are okay in this approach if you don't use MTS.

When IIS services an ASP request, it spawns a thread for this. Single-threaded and Apartment threaded applications (VFP's choices) are limited to the environment that exist on that thread.

If another user accesses the same page at the same time, IIS will spawn two threads and each thread will create its own copy of the COM object. Neither user will be able to access (or even be aware of) the other user's activities.

If MTS were involved, that would be a different story. MTS would handle the COM object creation and pass a proxy stub back to the ASP page. Each COM request (property setting, method call) would need to get a reference from MTS. MTS may create several COM objects to handle several requests simultaneously, but it will manage them internally. This means that the COM object you start with in COM call 1 may not be the COM object you end up with in COM call 3. It is stateless!

HTH.

FWIW, you may want to look at another way of doing this. If the page in question is going to be hit a lot, performance may become an issue because you are constantly instantiating and destroying an object. This may be a reason to implement your COM server as a Session variable that is created when the user first enters your site.

For more information on this issue and the entire VFP COM and ASP subject, you can take a look at Rick Strahl's article on the subject. http://www.west-wind.com/presentations/aspobjects/ASPObjects.htm

Good luck!

>Hi
>
>I have a question on the use of VFP com components from asp pages. The question is regarding multi-threaded com servers that have page level scope - where the object is created and destroyed on the same asp page. (I am not trying to maintain state between requests). With components of this type, is it acceptable to do the following from an asp page:
> - instantiate the com server
> - set some object properties
> - call a method
> - check the value of one or more object properties set by the method
>I don't understand how vfp will handle multiple users accessing the page/component and attempting to access the same pem's simultaneously. Are multiple users each working with their own independent instance of the com server, or will one user's property settings change the values for another user?
>If an asp page calls a component method, is it possible for the method to call other class methods before returning a value to the asp page, or does all logic have to be contained within a single method call?
>
>Thanks and regards
>Bill Sabo
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform