Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Checking for new messages in database

 
James Haville
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Not sure which section this should be in...

I've been working on a web-based project management system and was wondering how you may do the following:

1) When a user has a new message/comment on activity relating to them I want it to appear on their notifications
2) I want to display the number of notifications they have

So I will have to check the database for messages or comments. But how can I work out if these have not been accessed by the user and therefore whether to include them in the new notifications? Would I have a boolean value checking this somewhere(in a servlet?) which is returned from a database method (check number of times accessed...if zero then show in notifications). Maybe I would have a column in the database which has a value true or false as to whether its been accessed or not which is changed to true if it has been.

Does anyone have any suggestions?

Thanks

James
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64851
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You never store anything in the servlet,which must be written to be multithreaded.

If it's something that only applies to the current user's session, store info in the session. If the info must persist across sessions, it must be stored in the DB or other persistent storage.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic