• 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Checking for new messages in database

Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?


Posts: 67590
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
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.
    Bookmark Topic Watch Topic
  • New Topic