COM Component on Application Scope 
Author Message
 COM Component on Application Scope

Hi, we're designing a e-commerce site which is supposed to easily support
multiple languages.

To accomplish this an external consultant has created a VB6 COM component,
which is apartment threaded.
The way this currently has been set up is:

* In the Global.asa we create an instance of this object, and we read all
the translations (approx 300 entries) from the DB in memory.
Set LanguageObj = Server.CreateObject("Language.Dictionary")
LanguageObj.getFromDB(myDSN)
Set Application("LT") = LanguageObj

* Then in each file that needs translating (which is most of them), we call
on this Application variable, using an include file containing this function

Function Trans (StringToTranslate, sUserLanguage)
 On error resume next
 Dim text
 text = Application("LT").Lookup(CStr(StringToTranslate),
CStr(sUserLanguage))
 Trans = text
End Function

(example) in the welcome page, this would be called like Response.write
Trans("[welcome_text]", "FR").

This works and since it's all stored in-memory, it's very fast.
But I'm a bit concerned about scalability.  If the site gets something like
200 concurrent users (which it will), will this approach create a Bottleneck
situation, since all users are in fact using the same object.
This object does run under MTS, but I'm not sure this will make much of a
difference, since there's only one instance of it created in the whole site.

Does anyone have any experience with a similar situation? Any feedback is
appreciated.

Many thanks,

Sam Goutsmit

MCP Visual Interdev



Tue, 02 Jul 2002 03:00:00 GMT  
 COM Component on Application Scope

Quote:
> [snip]
> This works and since it's all stored in-memory, it's very fast.
> But I'm a bit concerned about scalability.  If the site gets something
like
> 200 concurrent users (which it will), will this approach create a
Bottleneck
> situation, since all users are in fact using the same object.
> This object does run under MTS, but I'm not sure this will make much of a
> difference, since there's only one instance of it created in the whole
site.

> Does anyone have any experience with a similar situation? Any feedback is
> appreciated.

I have been able to get multithreaded access in MTS to shared data
structures by making  MTS object with threading model of both that accesses
a static shared data structure. More specifically, the shared data
structure is a static member of the class implementing the interface.

The MTS COM object forwards calls the shared data structure.

When appropriate, this data structure must protected with a mutex when
updating or loading.

Hope this helps.

Jerry



Sun, 07 Jul 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ASP components and application scope

2. Connecting VBScript application to ATL/COM/DLL server component

3. VB COM component in Win2k Component Services

4. COM component as a Visual component??

5. Session Scope Server Component

6. COM component as a Visual component??

7. Com and Com+ component

8. Where can i find Com+ Services type library or Component services com+ 1.0 for Win98

9. COM object scope -- Help

10. COM object scope -- Help

11. Upgrading components without re-installing application that uses component

12. How to caching the vb object in application scope

 

 
Powered by phpBB® Forum Software