According to my reading of the JTA specification, XAResource.prepare may return XA_RDONLY when "The transaction branch has been read only and has been committed." Furthermore, I have examined the TransactionImpl.commit() code and discovered that it takes advantage of this fact. If prepare returns XA_RDONLY, it may (depending on the other XAResources) not call XAResource.commit().
Unfortunately, the implementation of PoolItem in Resin at the moment does not respect this. It does not check for XA_RDONLY in its prepare method. The only place that resource cleanup (and release to the pool) occurs is in commit or rollback.
It seems to me that prepare in PoolItem should be checking for XA_RDONLY. If it finds it, it should clean up the resource and release it to the connection pool.
We are attempting to expand our production Resin environment to use distributed transactions. This bug is causing certain connections to remain "active" forever, despite the fact that the Oracle XA driver thinks they've committed. This eventually fills the connection pool with active connections that are doing nothing and prevents subsequent requests from obtaining connections. In turn, this forces us to restart Resin.