I sort of use the same thing, storing the user in the Session.

Only I store a LoadableDetachableModel in the Session, representing the user. In my scenario, the LDM is a custom Model and the key identifier is a Long number, but that shouldn't be a difference.
And the injection happens in the LDM as well.

This works fine in both development & deployment mode.

And if any data is updated in the database, Hibernate is smart enough to detect the changes and serves the latest data from the database. If no changes occurred, a cache call is made.


On Mon, 03 Oct 2011 10:19:28 +0200, Zeldor <[email protected]> wrote:

So it's normal that I lose User data when I move from login to main page and
I will have to fetch it from db quite often.

When will it happen? I have users browsing around my app, doing most often
nothing. Plenty of labels with gets. Will browsing like that trigger
fetching user data from db? Or will that data be served from cache?

Whenever anything changes data will be stored in db and page will reload.
Will it fetch data from db again or serve them from cache?

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Authentication-and-sessions-the-right-way-tp3866840p3866875.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



--
Using Opera's revolutionary email client: http://www.opera.com/mail/

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to