Click to See Complete Forum and Search --> : db lookups versus sessions


pmntdaylt
01-19-2003, 01:11 AM
hello again all,

i have another newbie question... is it better to do a lot of db accesses to reread data, or should i store things i grab from a db into a session object to allow it to transition to new pages...

i could easily create a js object that represents some db record, read in the record from the db, and then store it in Session... i know that db accessing can be costly, but so can holding memory in the session (especially if i'm dealing with a large volume of objects coming from a db)...

ack to memory usage!

mike

Bullschmidt
01-19-2003, 03:50 AM
If you're talking about some main fields like key fields and the username and userlevel, I'd vote for session variables.

vishu_gupt
01-19-2003, 11:29 PM
HI,
I will not suggest you to use Session objects to store bulk amount of data. If it is 2-5 small key values you want to be available on each page then you can use Session objects but if it is a bulk data and you do not require that on each and every page then better to use database communication that time. MEMORY is more expensive then database connections.