• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

need to update logout details into database when client machine shutdown

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Of course, if there is a catastrophic shutdown, there's no event that will be triggered.
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no 100% sure way of getting this result.

I think that relay on waiting session timeout.
 
Greenhorn
Posts: 22
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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".
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic