HiveBrain v1.2.0
Get Started
← Back to all entries
patternModerate

Is polling the only way for updating app's data from a database?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
thepollingappupdatingwaydatabaseforfromdataonly

Problem

An application needs to have data as more freshly updated from a database as possible. In such a case, is there any other way for getting the data, besides of a timer based requesting (polling) the database?

I work with a MS SQL Server 2008 (and .NET applications + Entity Framework), but I'd like to get knowing about other types of databases as well.

Solution

In Oracle you can use the built in DBMS_ALERT package to facilitate this.


DBMS_ALERT supports asynchronous
notification of database events
(alerts). By appropriate use of this
package and database triggers, an
application can notify itself whenever
values of interest in the database are
changed.


Suppose a graphics tool is
displaying a graph of some data from a
database table. The graphics tool can,
after reading and graphing the data,
wait on a database alert (WAITONE)
covering the data just read. The tool
automatically wakes up when the data
is changed by any other user. All that
is required is that a trigger be
placed on the database table, which
performs a signal (SIGNAL) whenever
the trigger is fired.

Context

StackExchange Database Administrators Q#1570, answer score: 10

Revisions (0)

No revisions yet.