You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Jukka Zitting (JIRA)" <ji...@apache.org> on 2010/03/19 14:41:27 UTC
[jira] Updated: (JCR-2578) Deprecate XASession
[ https://issues.apache.org/jira/browse/JCR-2578?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jukka Zitting updated JCR-2578:
-------------------------------
Attachment: JCR-2578.patch
Proposed patch.
> Deprecate XASession
> -------------------
>
> Key: JCR-2578
> URL: https://issues.apache.org/jira/browse/JCR-2578
> Project: Jackrabbit Content Repository
> Issue Type: Improvement
> Components: jackrabbit-api, jackrabbit-core, jackrabbit-jca, transactions
> Reporter: Jukka Zitting
> Attachments: JCR-2578.patch
>
>
> The XASession interface in jackrabbit-api extends Session with a single getXAResource() method. The idea is that a transactional client (or a transaction manager) will test whether a session implements XASession and can then get the XAResource instance that can be used to bind the session to a distributed transaction. The essential code is:
> if (session instanceof XASession) {
> return ((XASession) session).getXAResource();
> }
> This works fine except for the extra dependency to jackrabbit-api that it introduces in code that otherwise would only need the JCR API. Since the link between a transaction-enabled session and the related XAResource instance is always one-to-one, we could avoid this dependency by making the session directly implement XAResource, leading to code like this:
> if (session instanceof XAResource) {
> return (XAResource) session;
> }
> This is essentially what jackrabbit-jcr-rmi did in 2.0.0 to avoid the jackrabbit-api dependency while maintaining XA transaction support, and I'd like to extend this solution also to other parts of Jackrabbit.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.