Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

need to update logout details into database when client machine shutdown  RSS feed

 
ramesh kancherla
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi team,
in my application i am doing Login.jsp.
When user is login into application, i am updting login value in datebase column as 1 'one'
when user logout it is 0 'zero'

login --> 1
logout -->0

when suddenly client system shutdown due to power loss.

in this case how can i make changes login value from 1 to 0 in data base.

can any one please suggest me.

Thanks in advance

Regards
Ramesh
 
Stefan Evans
Bartender
Posts: 1834
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My preferred method for this is to have an object stored in the session which implements the SessionBindingListener interface.
Whenever it is put into/taken out of the session it fires its event.

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course, if there is a catastrophic shutdown, there's no event that will be triggered.
 
Duc Vo
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Of course, if there is a catastrophic shutdown, there's no event that will be triggered.

In such case, the server starting events can be used to reset the flag to 0 for all users flagged as 1.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no 100% sure way of getting this result.

I think that relay on waiting session timeout.
 
Victor Hugo M Machado
Greenhorn
Posts: 22
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you implement something on the client that it is all the time communicating with the server .. you know when the client stops communicating on the same second, so will your "event " to capture and treat ... only that their application can be a drug .. very heavy .. maybe the client 'll be very fat

would be almost as reducing the minimum time session
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Duc Vo wrote:
Bear Bibeault wrote:Of course, if there is a catastrophic shutdown, there's no event that will be triggered.

In such case, the server starting events can be used to reset the flag to 0 for all users flagged as 1.

I was hoping that the OP was goig to come up with that idea on his own. Sigh.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Victor Hugo M Machado wrote:if you implement something on the client that it is all the time communicating with the server .. you know when the client stops communicating on the same second, so will your "event " to capture and treat ... only that their application can be a drug .. very heavy .. maybe the client 'll be very fat

No. The script for this would actually be rather small.

The problem is that if the client detects this situation, how can it affect the database? It can't.

The solution, as already pointed out, is to make sure that the database is normalized to a consistent state upon startup, just in case it went down "dirty".
 
Nilaxi Mecwan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
We have develop the EC2 for our company. Now i want to store the client machine shut down time
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!