Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

udpating a bean when a user updates database

Status
Not open for further replies.

Bezek

Programmer
Jul 24, 2000
2
US
Without using Enterprise Beans, what is the best way to accomplish the
following situation ...

When a user first comes to a jsp page certain database information
will populate the users session bean as a vector of objects (in this
case a vector of 'project' objects). While the session is active the
user will be able to modify the vector (ie- edit project objects,
delete some, add some).

The problem I have is how can I make sure this user has the current
set of objects at all times if the database is only accessed once upon
the users first instatiation of the bean. I was reading briefly in the
Wrox Proffesional JSP book about setting up "PropertyChangeListners"
and was wondering if this is good (or even possible) way to go about
it? If so could I still give the users bean "session" scope or should
it be "application" scope ?

I'm new to this.. so any dummied down responses will not be taken as
an offense:)

Thanks,
Rick
 
i did not get your problem exactly. any way
it is not adviceble to use bean in session unless it is necessry
write me claerly
somasekhar@webveda.com
i will clarify
bye

soma sekhar
 
What I want to avoid is having to constantly do queries to the database as the user goes to different jsp pages. To avoid this I thought it would be a good idea to store the database information in a bean. When the user goes to different pages the bean would then contain a collection of the database information and I wouldn't have to take the time to make new queries to the database. I'm not sure, however, how to make sure that this information is always up to date, since some other could make a change to the database and the user with the database information stored in his bean would never be aware of this. How is this problem best dealt with?
Thank you,
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top