Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COM+ , use of SetComplete
Message
De
10/11/2004 12:40:29
 
 
À
10/11/2004 07:50:06
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00959728
Message ID:
00960104
Vues:
8
Thanks Stuart,

Your response clarified some things for me, in that I believe this design I'm working on requires a different approach to actually reap the rewards COM+ has to offer. See my response to Craig for the ramblings that lead me to this conclusion, but what you have said supports the idea.

1. Create a set of components that mirror the database tables , which perform basic create/update/delete/find functions.
2. Create a second set that mirror the application functions that use the components in #1 to do their work.
3. The UI then instantiates components from #2 to provide the functionality desired.

While that is easy to say, doing it is another matter :)

This is in the context of an experimental design, but then if I don't do that correctly, it doesn't constitute a fair test.



>> Is it better to instantiate the component, save the values someplace, then release it.
>> Then instiate it again, read the values, etc... or is it better to instantiate the
>> component and keep using the same one.
>
>COM+ is stateless, and it's always a mistake to try to make it any other way.
>
>> However, you are correct that you'll only call SetComplete()
>> when you have totally finished using that instance of the component.
>
>I disagree: apart from ignoring SetComplete's function of notifying COM+ that a transaction can be committed, use of SetComplete allows COM+ to scale. The object isn't released until the application's idle shutdown
>timeout is reached. Each server call should make no assumptions about state, obtain a context reference at the start, and call SetComplete at the end (or SetAbort if needs be). That's how COM+ works best.
>
>In a crude way - what if the user leaves your app open when going to lunch but then goes straight home feeling ill? Your server object will sit there until the app is closed when the user returns.
>
>>My reading tells me that the call to SetComplete() tells the component
>> the client is finished with it, and it may end up cleared from server memory.
>
>Yes, if there are no further calls from the original client, or any other client. COM+ caches the object, though, for when it's called next.
>
>> I have a server-based component designed to perform some app-specific searches,
>> which is called from the client form. If I want to have the same client
>> use the component for multiple calls to these search methods over a long
>> data entry session, should SetComplete() be used at the conclusion of these methods like that?
>
>Yes, very much so. In my opinion.
>
>Regards
>
>Stuart
Jim Newsom
IT Director, ICG Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform