Subject Re: [Firebird-Java] Re: JNI and events - anybody out there!!
Author Jim Starkey
blahclayton wrote:

>
> I have posted this question (see previous post) on the firebird-java
> forum with little
> response so I was wondering if anybody has even tried created a JNI
> to wait for database events?
>
The synchronous form of the event call should be straightforward if you
have the database handle, which is a very big "if" if you're using
Jaybird. Perhaps there's some magic. The asynchronous form is probably
impossible, but given threads, also unnecessary.

Jaybird, however, is a pure Java driver that talks line protocol, so JNI
isn't really a solution. But the implementation wouldn't be difficult.
A little handshaking with the server, a secondary socket, and some bits
back and forth is all that is necessary. But before you start coding, I
suggest you give some deep and serious thought as to how events should
be modelled in Java. The underlaying event mechanism uses a listener
(either a dedicated thread or an AST) to deliver event notification to
the client. The event mechanism is encumbered with a patent and while
Borland has granted a license to the patent for the open source version
of Interbase, a little legal work might be in order if want to
generalize it to work with other RDMSes. Personally, having to desire
to wrangle with Borland's legal goons, I choose to give it a miss.

But it's a useful feature and somebody ought to get it playing nicely
with Java. But I doubt that it's a quickie kinda project.

--

Jim Starkey
Netfrastructure, Inc.
978 526-1376