users@glassfish.java.net

Re: User logs out, fires event

From: Ryan de Laplante <ryan_at_ijws.com>
Date: Sun, 27 Apr 2008 11:20:13 -0400

when you say the user logs off, I understand that as a link the user
clicks which calls into your code to invalidate the session. Why not
put the code to unlock there?

If you mean the user closes the browser without logging out, or session
times out, maybe you can find a way to detect when a session scoped bean
is being destroyed. I think JSF can tell your app when a session scoped
managed bean is being created and destroyed.


Ryan


glassfish_at_javadesktop.org wrote:
> Hi,
>
> Imagine there is a web-app up and running on Glassfish. There are perhaps five users logged in and using the app. How is it possible to call a class method (fire an event?) when any user logs off, passing to that method the user's ID?
>
> The reason I ask: The users will be accessing and modifying DB records. When the user "checks out" the record a lock is placed on it denying other users to view or modify. Naturally I have provided the user the ability to "check in" the record but in order to stop records remaining locked if the user forgets to check it in I need a way to automatically do so, hence when they log off I would like the server to automatically check to see if they have current locks in place and if so to remove them.
>
> By the way, the "lock" is simply a field in the DB row set to "LOCKED". I am specificaly not using any in-built DB locking facility.
>
> Any help, as ever, much appreciated.
> Cheers
> Hugh
> [Message sent by forum member 'hughacland' (hughacland)]
>
> http://forums.java.net/jive/thread.jspa?messageID=271666
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>