Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I cache/pool my VB Object?

Status
Not open for further replies.

MattWoberts

Programmer
Oct 12, 2001
156
GB
Hi,

I have a small VB6 COM component that deals with dataacess - it executes SQL statements against a database using ADO. Its an ActiveX DLL, and is apartment threaded (default settings).

My problem is that there is a reasonable amount of initialisation code that my COM object needs to do - it needs to load the connection string from a config file. This data access component is used frequently by many clients - which are other COM components called from ASP pages. What this means is that the init. code that gets the connection string from the config file is repeated often per page request - in some cases upto 20 times !!

I want to do something about this, but in VB6 I seem to be limited to what I can do. Ideally, I would pool my object and use COM+ to manange that, but I believe I can't pool VB6 objects in COM+ because of the threading model they use. Is this true?

Other options I have:

1) Re-write the VB6 class in VC++/ATL, which should allow me to configure it for object pooling..

2) Instead of pooling, once I have the connection string (which is static), cache it somewhere (but where?)

Any pointers would be very welcome!! I'm completely new to COM+ so I dont know how/if it can help me here...

 
Matt, did you ever resolve this issue? I've got an identical scenario and am looking for a solution.

Thanks - Kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top