473,395 Members | 1,488 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,395 software developers and data experts.

Arrays or Rs in Sessions : Help me plz

Hi all,

I've got an issue with session variables in asp pages. I need to make a
decision that I think you can hopefully help me out here.

When a session starts on the iss server I need to store some information in
some session variables. But this information is coming from an old dbase
system. In the beginning of this project it was just a simple static array
of information. Afterwards it turns out that this must be a dynamic array
that we could change in other asp pages.

Now, at this moment, it is even worse! There are several dynamic arrays
(max10) with a lot of records (max100) and intensive changing of data in
those arrays, sorting it and so on.

The big problem is that I cannot write the changes in those dbases in a
direct way and request them back. I know, it would help me a lot. Don't ask
why! Ask this question to the green project manager!

When the user is logging out then all changes will be save as an xml-file on
the server, and some queuing service is picking this up a minute later to
control all the data and do finally some dbase changes.

My question is: can I change the arrays into disconnected record sets and
store them into session variables? I'm using NT2K server with II6. In the
old days (nt4 IIS4) they always said that storing objects into session
variables are a bad way of programming for IIS. But in this case and with
II6???

Some comments would be nice!

Thanks in adv.
Best regards,
John
Jul 19 '05 #1
3 1403

"John" <fa***@facke.null> wrote in message
news:40**********************@news.skynet.be...

My question is: can I change the arrays into disconnected record sets and
store them into session variables?
Yes. The quick way is to use the .GetRows() method of the recordsetup
object to convert a recordset into a two dimenionsal array. Either that, or
just store the data that you need in arrays you build yourself. You don't
want to store objects in session variables.
(http://www.aspfaq.com/show.asp?id=2053)
I'm using NT2K server with II6.
NT2K? he he he...

If you're using Windows 2000 Server, you're using IIS5. IIS6 is on Windows
Server 2003 only.
In the
old days (nt4 IIS4) they always said that storing objects into session
variables are a bad way of programming for IIS. But in this case and with
II6???


Still true!

If I were you, I'd go kick the project manager's rear.

Ray at work
Jul 19 '05 #2
Hoi Ray@work :)

Actually I'm receiving the data in an xml format and must convert it into a
recordset, then save it in an array using GetRows + redim the array to add
some more fields to it for internal usage.

Finally store the array into a session object.

The following page will fetch the array in the session object and convert it
back to a connectionless recordset, doing some stuff with it (sort, add,
change data, delete data,.) and the last step will be convert it back to an
array and store it back into the session object. This will be done for
several arrays on several pages :(
John: I'm using NT2K server with II6.

Ray : NT2K? he he he...
:) indeed, its win2K with IIS5

John: In the old days (nt4 IIS4) they always said that
John: storing objects into session variables are a bad
John: way of programming for IIS.

Ray : Still true!
I do remember Mr. Charles Carroll say something long ago about this issue,
but was wondering that ms-people solved this issue in some way or another.
Ray : If I were you, I'd go kick the project manager's rear.


Why do you think he's green! His balls are disabling him to breathe ;)

Do I really have to do all this work :( damn!

Thanks Ray!
John.

Jul 19 '05 #3
John wrote:
Hoi Ray@work :)

Actually I'm receiving the data in an xml format and must convert it
into a recordset, then save it in an array using GetRows + redim the
array to add some more fields to it for internal usage.
Finally store the array into a session object.

The following page will fetch the array in the session object and
convert it back to a connectionless recordset, doing some stuff with
it (sort, add, change data, delete data,.)
Why not work with the array? What is the purpose of creating a recordset
object here? I assume you are talking about creating an ad hoc array, adding
fields to the Fields collection via the Append method and putting the data
from the stored array into it. Why go through this trouble when you can more
efficiently work with the array? It's not like you are going to be able to
connect the ad hoc recordset to the data source and persist the changes
you've made.

Instead of the array, you might want to consider using an xml document,
which will be a little easier to work with than the array.
and the last step will be
convert it back to an array and store it back into the session
object. This will be done for several arrays on several pages :(
John: I'm using NT2K server with II6.

Ray : NT2K? he he he...
:) indeed, its win2K with IIS5

John: In the old days (nt4 IIS4) they always said that
John: storing objects into session variables are a bad
John: way of programming for IIS.

Ray : Still true!


I do remember Mr. Charles Carroll say something long ago about this
issue, but was wondering that ms-people solved this issue in some way
or another.


No. Especially if Access is involved. There is a way to make ADO objects
free-threaded (and therefore capable of being stored in Session), but this
should be avoided if Access is being used on the server, because Jet is
single-threaded.

If Access is not involved, you can make a registry change to cause ADO
objects to be free-threaded, using a batch file that is installed by MDAC in
the ...\project files\common files\system\ado folder called makfre12.bat.

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"
Jul 19 '05 #4

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

Similar topics

13
by: jing_li | last post by:
Hi, you all, I am a newbee for php and I need your help. One of my coworker and I are both developing a webpage for our project using php. We have a copy of the same files in different location...
6
by: Fnark! | last post by:
I am creating a shopping cart using PHP Version 4.1.2. I am creating and registering a cart object in a session. The cart object contains an array of arrays called $order whose elements are a...
3
by: LMachado1 | last post by:
I just started with php and I'm trying to make a simple interface as follows: - user is asked to input an integers, for example: how many students do you want to enter? - user is then shown a...
3
by: Maxime Ducharme | last post by:
Hi group We have a problem with sessions in one of our sites. Sessions are used to store login info & some other infos (no objects are stored in sessions). We are using Windows 2000 Server...
6
by: Daniel O'Connell | last post by:
Two questions here: 1. Is there any particular reason why when using stackalloc, the code byte *buffer = stackalloc byte; works, but code like byte *buffer; buffer = stackalloc byte; is...
6
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for...
9
by: duzhidian | last post by:
Hello: There are a couple techniques to move information from different html web page to web page. 1. URL; 2. Cookie; 3. Form; 4. Session; All the examples I found are move distinguished...
3
by: sjsean | last post by:
All thanks in advance for reading my post. I am new to using js and more accustomed to vbscript. I had written code which created a shopping cart into an array using vbscript and then...
5
TheServant
by: TheServant | last post by:
Is there any problem with using session.auto_start in the php.ini instead of declaring session_start() on every page? Also, can sessions store arrays, and if so, is this a good idea?
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.