Click to See Complete Forum and Search --> : Stateful web apps
Shaolin
08-31-2008, 11:52 PM
Hi Guys,
I want to know what kind of info I cannot load onto a session bean. I know passwords are out of the question, but what about addresses, telephone numbers,emails, DOB, post/zip code etc?
chazzy
09-01-2008, 01:18 AM
You mean this kind of session bean? (http://en.wikipedia.org/wiki/Session_Beans) If so, I see no reason why data can't be kept in it. If it's stateful, the instance you get will keep the old state. If it's stateless you'd need to request the data each time. if you're talking about entity editing in conjunction with JPA, it's a common approach, and in fact the basis for jboss's seam environment.
Shaolin
09-01-2008, 01:54 PM
Not too sure. I don't think I'm using an enterprise java bean since I'm building the application on J2SE. Its a normal class will getter/setter methods. I think my biggest problem is if variables on the DB are changed, the session state will maintain the old state, but then on the good side I won't be making as many DB requests. Ahh, confused on what to do.:confused:
chazzy
09-02-2008, 07:20 AM
but...how can it be J2SE if the topic of this thread is "stateful web apps"?
i think what you're talking about is an entity then, something that contains data, but you need to keep in sync. the issue you're talking about is a common one. the only good advice i can give is that you need some kind of column that dignifies the last time a row was updated. it should be a value that the end user can't change, only your app can, and if this value is different when you try to save the form, you should throw an error back saying that the value's out of date.