Subject | Re: [Firebird-Java] firebird events api, asynchronous, disconnect |
---|---|
Author | unordained |
Post date | 2008-08-06T22:54:55Z |
FYI, the result of testing was this: no errors are thrown immediately when the connection to the
server is lost while using the asynchronous API, but CPU usage spikes, and further attempts to
register events or unregister events or disconnect (which tries to unregister events) will throw
exceptions. The FBEventManager cannot be re-used once this happens. Not sure why this is so
different from the behavior of synchronous waits, given that those internally use the asynchronous
API calls, a separate thread, and some locking. Created ticket JDBC-125 to track.
As long as I don't shutdown FB, my test app runs fine -- receives all registered events relatively
quickly and correctly, great for jobs processing. I'd hate to have to bounce Tomcat because
although the normal connection pool reconnected correctly after a database server shutdown/restart,
the background 'jobs' thread couldn't (and seemingly ate all the cpu?)
Thanks,
-Philip
---------- Original Message -----------
From: "unordained" <unordained_00@...>
To: Firebird-Java@yahoogroups.com
Sent: Fri, 1 Aug 2008 18:18:59 -0500
Subject: [Firebird-Java] firebird events api, asynchronous, disconnect
server is lost while using the asynchronous API, but CPU usage spikes, and further attempts to
register events or unregister events or disconnect (which tries to unregister events) will throw
exceptions. The FBEventManager cannot be re-used once this happens. Not sure why this is so
different from the behavior of synchronous waits, given that those internally use the asynchronous
API calls, a separate thread, and some locking. Created ticket JDBC-125 to track.
As long as I don't shutdown FB, my test app runs fine -- receives all registered events relatively
quickly and correctly, great for jobs processing. I'd hate to have to bounce Tomcat because
although the normal connection pool reconnected correctly after a database server shutdown/restart,
the background 'jobs' thread couldn't (and seemingly ate all the cpu?)
Thanks,
-Philip
---------- Original Message -----------
From: "unordained" <unordained_00@...>
To: Firebird-Java@yahoogroups.com
Sent: Fri, 1 Aug 2008 18:18:59 -0500
Subject: [Firebird-Java] firebird events api, asynchronous, disconnect
> If I use the synchronous events API, database disconnect errors are thrown by the
> eventManager.waitForEvent() method; what's the expected result if I switch to using the
> asynchronous API instead?
>
> I'm specifically looking to support auto-reconnect; I use jaybird's connection-string
> options for this for my tomcat resource (?autoReconnect=true), but I don't think it'll
> accept those same options via eventManager.setDatabase(), so I need to actually trap
> database disconnect errors, and attempt to reconnect and re-register my interest in events.
>
> Thoughts? Thanks!
>
> -Philip
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>