Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


udpating a bean when a user updates database

udpating a bean when a user updates database

udpating a bean when a user updates database

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:)


RE: udpating a bean when a user updates database

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
i will clarify

soma sekhar

RE: udpating a bean when a user updates database

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,

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close