473,379 Members | 1,278 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Session Variables holding VB COM objects (Apartment Threading)

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.

*** Sent via Developersdex http://www.developersdex.com ***
Dec 8 '05 #1
4 1718
Andy Kasotia wrote:
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

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Dec 8 '05 #2
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.
*** Sent via Developersdex http://www.developersdex.com ***
Dec 8 '05 #3
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.

*** Sent via Developersdex http://www.developersdex.com ***
Dec 9 '05 #4
Andy Kasotia wrote:
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
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Dec 9 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: DrewM | last post by:
I'm still thinking about session variables :-) Does anyone know the detail of how session variables are actually stored? The question I'm trying to answer is: Is it more efficient to store and...
14
by: mjkahn | last post by:
I've read (and read!) that you shouldn't store objects in Session variables. I've read these reasons: - The object takes up memory that may not be freed until the session times out. Better to...
6
by: Just D | last post by:
Hi, How slowly is to work with these objects - Application and Session ? Is it much better to create a huge project or some static library and place all variables/constants there instead of many...
31
by: Harry Simpson | last post by:
I've come from the old ASP camp where session variables were not used. When i started using ASP.NET in 2001, I started using them again because it was ok from what I'd read. I've been merrily...
2
by: Markus Prediger | last post by:
Hi NG, I have an asp.net project that uses an vb6 com object for some database-manipulation (I cannot rewrite it in .net, sorry, its not my decision). I want it to be instanciated seperately...
6
by: Gary Lee | last post by:
In VB.NET using CDO, I'd like to allow multiple threads to share a single MAPI.Session object. If I declare and instantiate sessions within each thread, I'm OK (although this negates the...
12
by: Anthony Jones | last post by:
Here's a question that I've not been able to get a definitive answer to. Creating an STA object (such as a typical VB6 object) and assigning to the ASP Session store is a bad thing. It's a bad...
9
by: david | last post by:
I have a class with some business-logic and with every roundtrip, I need an instance of this class, so I have to create it, every time again. That doesn't seem very efficient. I thought it would...
1
by: =?Utf-8?B?QXZp?= | last post by:
Hi I have an interesting issue, I hope someone can shead light on: I have a 2 server "web farm" with a web app that produces image files. To ensure synchronization of content on both machines,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.