Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Elegant solution instead of polling database

 
Vladas Razas
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have application A which updates DB and server B which reads data from DB. The server needs a way to get new data as soon as it becomes available.

1. Database polling? RRrrr I don't like that.
2. Make a intermediate module? Something like web service which is responsible for all DB access for both server and application.

I don't use EJB at this point so I can't take advantage of entity beans.
DB triggers? Is it possible to get information on DB update in standard way which would be portable accross different DB engines?
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A service layer on top of the database would do it. So would a JMS queue. And to be honest, if your needs are simple then polling isn't that much of a crime.

- Peter
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic