Subject Re: [Firebird-Java] Re: Events
Author Jim Starkey
nagypapi wrote:

> I never tried it, but postgre has some kind of event mechanism:
> http://www.postgresql.org/docs/7.4/interactive/sql-listen.html
> http://www.postgresql.org/docs/7.4/interactive/sql-notify.html
>
There are major differences between the Interbase and Postgres
mechanisms. The Interbase scheme allows asynchronous notification,
supports notification for one or more of a list of events, and works in
a threaded environment. The Postgres scheme requires that program
periodically poll to see whether a given event has been delivered. The
Interbase scheme also gives an indication of the number of times an
event was posted between notifications. Interestingly enough, the
Postgres scheme doesn't allow notifications to take place when a process
has a transaction outstanding even though the process is required to
poll to see if the event occurred. This makes the mechanism useless in
an environment that support multiple transactions per attachment.

The Postgres mechanism can be trivially modeled in Interbase or
Firebird. The reverse is not true. More specifically, an API based on
the Postgres model would be a disaster for Firebird.

Please forgive me for double posting to Java and Architecture.