Session Variables holding VB COM objects (Apartment Threading)

A

Andy Kasotia

I have read couple of articles warning against the use of storing VB COM
objects (Apartment Threading) in Session Variables due to the fact that
these variables could go bad.

My question is what's the workaround this?

I have also read about making ASP Stateless...I'm guessing that means
turning the session and application variables off and if you do that
then how do you pass information for a particular user from one page to
another?

I'm confused about how to get an ASP site working without using
Application and Session variables as well as not storing VB COM objects
in Session Variables.

Any explanation in this regard would be very much appreciated.

Thanks,
Andy.
 
B

Bob Barrows [MVP]

Andy said:
I have read couple of articles warning against the use of storing VB
COM objects (Apartment Threading) in Session Variables due to the
fact that these variables could go bad.

My question is what's the workaround this?

All you can do is create arrays or xml documents containing the data
contained in the COM objects ans store them in session/application instead.
I have also read about making ASP Stateless...I'm guessing that means
turning the session and application variables off
You can only turn session off.
and if you do that
then how do you pass information for a particular user from one page
to another?
You would have to use a database, or txt/xml files on the web server
 
A

Andy Kasotia

Bob,

Appreciate your response. I'm not sure if I understand how to implement
what you're mentioning. Are you suggesting that whatever data retrieved
from VB COM Ojects should be stored in XML files and to include the XML
files on every ASP page? If that's what you are referring to then,
wouldn't we be creating lots of XML files for each user that logs in and
how would be make sure that the data in the XML files corresponds to the
user that requested the data? If you or anyone else reading this post,
just on a high-level explain the process and setup flow, I would
appreciate that.

Thanks much,
Anand.
 
A

Andy Kasotia

Bob Barrows or can anyone else give a high-level explanation of how the
above can/should be designed?

Appreciate all your responses in advance.

Anand.
 
B

Bob Barrows [MVP]

Andy said:
Bob,

Appreciate your response. I'm not sure if I understand how to
implement what you're mentioning. Are you suggesting that whatever
data retrieved from VB COM Ojects should be stored in XML files and
to include the XML files on every ASP page?

You've got it. That's exactly what i was talking about. You need a way to
persist the data from the COM object between pages, right? There's really no
need to persist the functionality in your COM object since it can be
instantiated whenever a page needs it.
If that's what you are
referring to then, wouldn't we be creating lots of XML files for each
user that logs in

Yes. A database may be a better solution ...
and how would be make sure that the data in the XML
files corresponds to the user that requested the data?

The naming convention for the files would include a reference to the user
that created them. It's up to you how this should be implemented. You could
even use the Session ID as part of the name of the files.
Again, a database would likely be better for this if you anticipate a lot of
user activity.

Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top