• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 488
  • Last Modified:

Creating Memory resident DLL in VB6

Hi Guys,
Is that possible to create a memory resident COM+ DLL in VB6. I want to cache a Oracle table data(Static data) in webserver. This component will be called by other components frequenlty and I don't want this component to access database each time.
I am using ADO and I don't want to do any file handling(persisting data in XML or something).
Or
Is there any possibility to share the ADO Recordset object created on that component to various instances of that component?

Any help or sample code will be highly appreciated.
0
sxmahesh
Asked:
sxmahesh
1 Solution
 
EDDYKTCommented:
I believe yes.
But you have to put all global declaration on module so that it can be shared by each instant.
0
 
EDDYKTCommented:
One more thing, are you running windows 2000 or xp, You have to add your component to com+ and set the server process shutdown to 'leave running when idle' on property page
0
 
sxmaheshAuthor Commented:
If you do a global declaration in Module, the object will be created for for each instances isn't it?

I am running Win2000 Advance server.
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
EDDYKTCommented:
You can check before you create

ie
if conn is nothing then
  do your connection and open database etc
end if
0
 
corvanderlindenCommented:
In my opinion all COM+ components should be stateless (object pooling and so on)

why not keep this specific DLL out of COM+ and share its data with your other components?

>> you do a global declaration in Module, the object will be created for for each instances isn't it ?
Yes, you cannot share data between different instances of a VB DLL unless you use something like memory mapped files or so (DLL's have a common code segment, but only if their base adresses are equal, but the have their own data segment).
0
 
sxmaheshAuthor Commented:
Hello Guys,

Thanks a lot for your answers. But found a way now.
It suddenly striked me why not to use ASP Application varibale to store the object.
I am using ASP Application scope variable in COM+. First time when the MSDTC is restarted, it will fetch the records and for the following instances just take the recordset object from Application variable. Cool isn't it?

Thanks a lot once again.

Cheers
Mahesh
0
 
EDDYKTCommented:
>>Yes, you cannot share data between different instances of a VB DLL unless you use something like memory
mapped files or so (DLL's have a common code segment, but only if their base adresses are equal, but
the have their own data segment).


I believe it is true if and only if your dll is not in com+
If you add your component in com+ you can set your dll run as server application on activation tab.
0
 
DanRollinsCommented:
sxmahesh, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:

    Refund points and save as a 0-pt PAQ.

DanRollins -- EE database cleanup volunteer
0
 
SpideyModCommented:
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now