Hello, minerva experts (I guess that means you, Aaron Mulder).

There are a couple of  "features" of the minerva XAStuffImpl 
implementation that are causing me some problems with my JCA implementation.

Quick background: I'm using Sun's reference resource adapter (called 
"BlackBox") to test my implementation. This resource adapter is pretty 
much just a wrapper around the javax.sql stuff to make it fit into the JCA.

The first seems to have a trivial fix. In XAResourceImpl.start, it is 
currently not permitted to call start, then end, then start again even 
if the second start is for the same Xid as the first. My JCA 
implementation really wants to do this as it means that the transaction 
handling stuff is simpler (pure XA with no fancy connection sharing or 
local transaction optimisation or nuffin').

The second seems less trivial to fix. In FooInPool, every time an 
SQLException is thrown by the wrapped Foo an error event ends up being 
fired to the ConnectionEventListeners. The registered listener in my 
case is the resource adapter, which in turn fires off an error event to 
my JCA implementation, which responds by destroying the connection.

The only specification of when an error event should be sent that I can 
find is in the API docs, and it says:

"Invoked when a fatal connection error occurs, just before an 
SQLException is thrown to the application."

It also says:

"A ConnectionEventListener is also notified when a Connection error 
occurs due to the fact that the PooledConnection is unfit for future 
use---the server has crashed, for example."

My interpretation of this is that the listeners should only be notified 
of "fatal" errors, i.e. ones that mean that the connection is no longer 
useable. This is the interpretation that is given explicitly for the JCA 
version of ConnectionEventListener 
(javax.resource.spi.ConnectionEventListener).

So, either minerva needs to stop sending connectionErrorOccurred 
messages at the slightest provocation or the resource adapter needs to 
somehow determine which are fatal and which are not.

Toby.


Reply via email to