You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by "Niu, Xuetao" <xu...@Fiserv.com> on 2010/01/15 16:51:49 UTC

JTA compliance of Jackrabbit 2.0-beta5

Hello,

 

I am new to Jackrabbit and am looking forward to use 2.0 final release
in our project. When I am trying beta5 in Websphere6.1 (EJB feature pack
installed) Session bean, I got problems in JTA transactions. It would be
really great if any of you can provide some help!

 

What I am trying to do is to make a new version by adding some nodes to
another node "/data", which works all fine in JSE:

 

VersionManager.checkout("/data");

//adding new nodes to "/data"

Session.save();

VersionManager.checkin("/data");

 

If I annotate my method with TransactionAttributeType.NOT_SUPPORTED, the
thread hangs forever in the Session.save() method.

 

If I annotate my method with TransactionAttributeType.REQUIRED, I got
the following error messages:

 

[2010-01-14 18:38:05,932] [m Pool : 0] ERROR BundleDbPersistenceManager
- rollback failed

[2010-01-14 18:38:05,932] [m Pool : 0] ERROR BundleDbPersistenceManager
-        Reason: DSRA9350E: Operation Connection.rollback is not allowed
during a global transaction.

[2010-01-14 18:38:05,932] [m Pool : 0] ERROR BundleDbPersistenceManager
-    State/Code: null/0

[2010-01-14 18:38:06,432] [m Pool : 0] ERROR BundleDbPersistenceManager
- rollback failed

[2010-01-14 18:38:06,432] [m Pool : 0] ERROR BundleDbPersistenceManager
-        Reason: DSRA9350E: Operation Connection.rollback is not allowed
during a global transaction.

[2010-01-14 18:38:06,432] [m Pool : 0] ERROR BundleDbPersistenceManager
-    State/Code: null/0

Caused by: javax.jcr.RepositoryException: Unable to update item: node /

                at
org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1130)

                at
org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:919)

                at
com.fiserv.repository.jackrabbit.JRUtils.makeVersion(JRUtils.java:306)

                ... 34 more

Caused by: org.apache.jackrabbit.core.state.ItemStateException:
DSRA9250E: Operation setAutoCommit is not allowed during a global
transaction for Shareable Connections.

                at
org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager
.store(BundleDbPersistenceManager.java:583)

                at
org.apache.jackrabbit.core.state.SharedItemStateManager$Update.end(Share
dItemStateManager.java:732)

                at
org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedIte
mStateManager.java:1109)

                at
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemS
tateManager.java:351)

                at
org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateMa
nager.java:354)

                at
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemS
tateManager.java:326)

                at
org.apache.jackrabbit.core.state.SessionItemStateManager.update(SessionI
temStateManager.java:331)

                at
org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1124)

                ... 36 more

Caused by: java.sql.SQLException: DSRA9250E: Operation setAutoCommit is
not allowed during a global transaction for Shareable Connections.

                at
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.createSharingException(WSJdbc
Connection.java:1192)

                at
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.setAutoCommit(WSJdbcConnectio
n.java:2620)

                at
org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager
.store(BundleDbPersistenceManager.java:562)

                ... 43 more

Caused by: javax.resource.spi.SharingViolationException: DSRA9250E:
Operation setAutoCommit is not allowed during a global transaction for
Shareable Connections.

                at
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.createSharingException(WSJdbc
Connection.java:1193)

                ... 45 more

 

The FAQ/wiki page doesn't help and the mailing list archive doesn't help
either...

 

Thanks in advance,

Xuetao Niu

 

P.S. I expect to use mssql database to do all persistence, here is the
configuration file I am using:

 

<Repository>

    <!--

        virtual file system where the repository stores global state

        (e.g. registered namespaces, custom node types, etc.)

    -->

    <FileSystem
class="org.apache.jackrabbit.core.fs.db.MSSqlFileSystem">

        <param name="driver" value="javax.naming.InitialContext"/>

            <param name="url"
value="java:comp/env/jdbc/RtdeDataSource"/>

            <param name="schema" value="mssql"/>

    </FileSystem>

      <PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.MSSqlPersistenceMan
ager">

            <param name="driver" value="javax.naming.InitialContext"/>

                  <param name="url"
value="java:comp/env/jdbc/RtdeDataSource"/>  

                  <param name="schema" value="mssql"/>

            <param name="externalBLOBs" value="false"/>

        </PersistenceManager>

    <!--

        security configuration

    -->

    <Security appName="Jackrabbit">

        <!--

            access manager:

            class: FQN of class implementing the AccessManager interface

        -->

        <AccessManager
class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager">

            <!-- <param name="config" value="${rep.home}/access.xml"/>
-->

        </AccessManager>

 

        <LoginModule
class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule">

           <!-- anonymous user name ('anonymous' is the default value)
-->

           <param name="anonymousId" value="anonymous"/>

           <!--

              default user name to be used instead of the anonymous user

              when no login credentials are provided (unset by default)

           -->

           <!-- <param name="defaultUserId" value="superuser"/> -->

        </LoginModule>

    </Security>

 

    <!--

        location of workspaces root directory and name of default
workspace

    -->

    <Workspaces rootPath="${rep.home}/workspaces"
defaultWorkspace="default"/>

    <!--

        workspace configuration template:

        used to create the initial workspace if there's no workspace yet

    -->

    <Workspace name="${wsp.name}">

        <!--

            virtual file system of the workspace:

            class: FQN of class implementing the FileSystem interface

        -->

        <FileSystem
class="org.apache.jackrabbit.core.fs.db.MSSqlFileSystem">

            <param name="driver" value="javax.naming.InitialContext"/>

                  <param name="url"
value="java:comp/env/jdbc/RtdeDataSource"/>

                  <param name="schema" value="mssql"/>

            <param name="schemaObjectPrefix" value="ws_"/>

        </FileSystem>

        <!--

            persistence manager of the workspace:

            class: FQN of class implementing the PersistenceManager
interface

        -->

        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.MSSqlPersistenceMan
ager">

            <param name="driver" value="javax.naming.InitialContext"/>

                  <param name="url"
value="java:comp/env/jdbc/RtdeDataSource"/>  

                  <param name="schema" value="mssql"/>

            <param name="externalBLOBs" value="false"/>        

            <param name="schemaObjectPrefix" value="ws_"/>

            <param name="externalBLOBs" value="false"/>

        </PersistenceManager>

        <!--

            Search index and the file system it uses.

            class: FQN of class implementing the QueryHandler interface

        -->

        <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">

            <param name="path" value="${wsp.home}/index"/>

        </SearchIndex>

    </Workspace>

 

    <!--

        Configures the versioning

    -->

    <Versioning rootPath="${rep.home}/version">

        <!--

            Configures the filesystem to use for versioning for the
respective

            persistence manager

        -->

        <FileSystem
class="org.apache.jackrabbit.core.fs.db.MSSqlFileSystem">

            <param name="driver" value="javax.naming.InitialContext"/>

                  <param name="url"
value="java:comp/env/jdbc/RtdeDataSource"/>

                  <param name="schema" value="mssql"/>  

            <param name="schemaObjectPrefix" value="version_"/>

        </FileSystem>

        

        <!--

            Configures the persistence manager to be used for persisting
version state.

            Please note that the current versioning implementation is
based on

            a 'normal' persistence manager, but this could change in
future

            implementations.

        -->

        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.MSSqlPersistenceMan
ager">

            <param name="driver" value="javax.naming.InitialContext"/>

                  <param name="url"
value="java:comp/env/jdbc/RtdeDataSource"/> 

                  <param name="schema" value="mssql"/>         

            <param name="schemaObjectPrefix" value="version_"/>

            <param name="externalBLOBs" value="false"/>

        </PersistenceManager>

    </Versioning>

 

    <!--

        Search index for content that is shared repository wide

        (/jcr:system tree, contains mainly versions)

    -->

    <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">

        <param name="path" value="${rep.home}/repository/index"/>

    </SearchIndex>

</Repository>


Re: JTA compliance of Jackrabbit 2.0-beta5

Posted by Andreas Veithen <an...@gmail.com>.
Since the JTA transaction is handled by Jackrabbit, you need to
reconfigure the data source used by Jackrabbit such that it doesn't
itself participate in the transaction, i.e. the data source must be
non-JTA. If I remember well, in WebSphere the configuration property
is called "non transactional" (which is a bit misleading).

Andreas

On Fri, Jan 15, 2010 at 16:51, Niu, Xuetao <xu...@fiserv.com> wrote:
> Hello,
>
>
>
> I am new to Jackrabbit and am looking forward to use 2.0 final release
> in our project. When I am trying beta5 in Websphere6.1 (EJB feature pack
> installed) Session bean, I got problems in JTA transactions. It would be
> really great if any of you can provide some help!
>
>
>
> What I am trying to do is to make a new version by adding some nodes to
> another node "/data", which works all fine in JSE:
>
>
>
> VersionManager.checkout("/data");
>
> //adding new nodes to "/data"
>
> Session.save();
>
> VersionManager.checkin("/data");
>
>
>
> If I annotate my method with TransactionAttributeType.NOT_SUPPORTED, the
> thread hangs forever in the Session.save() method.
>
>
>
> If I annotate my method with TransactionAttributeType.REQUIRED, I got
> the following error messages:
>
>
>
> [2010-01-14 18:38:05,932] [m Pool : 0] ERROR BundleDbPersistenceManager
> - rollback failed
>
> [2010-01-14 18:38:05,932] [m Pool : 0] ERROR BundleDbPersistenceManager
> -        Reason: DSRA9350E: Operation Connection.rollback is not allowed
> during a global transaction.
>
> [2010-01-14 18:38:05,932] [m Pool : 0] ERROR BundleDbPersistenceManager
> -    State/Code: null/0
>
> [2010-01-14 18:38:06,432] [m Pool : 0] ERROR BundleDbPersistenceManager
> - rollback failed
>
> [2010-01-14 18:38:06,432] [m Pool : 0] ERROR BundleDbPersistenceManager
> -        Reason: DSRA9350E: Operation Connection.rollback is not allowed
> during a global transaction.
>
> [2010-01-14 18:38:06,432] [m Pool : 0] ERROR BundleDbPersistenceManager
> -    State/Code: null/0
>
> Caused by: javax.jcr.RepositoryException: Unable to update item: node /
>
>                at
> org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1130)
>
>                at
> org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:919)
>
>                at
> com.fiserv.repository.jackrabbit.JRUtils.makeVersion(JRUtils.java:306)
>
>                ... 34 more
>
> Caused by: org.apache.jackrabbit.core.state.ItemStateException:
> DSRA9250E: Operation setAutoCommit is not allowed during a global
> transaction for Shareable Connections.
>
>                at
> org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager
> .store(BundleDbPersistenceManager.java:583)
>
>                at
> org.apache.jackrabbit.core.state.SharedItemStateManager$Update.end(Share
> dItemStateManager.java:732)
>
>                at
> org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedIte
> mStateManager.java:1109)
>
>                at
> org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemS
> tateManager.java:351)
>
>                at
> org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateMa
> nager.java:354)
>
>                at
> org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemS
> tateManager.java:326)
>
>                at
> org.apache.jackrabbit.core.state.SessionItemStateManager.update(SessionI
> temStateManager.java:331)
>
>                at
> org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1124)
>
>                ... 36 more
>
> Caused by: java.sql.SQLException: DSRA9250E: Operation setAutoCommit is
> not allowed during a global transaction for Shareable Connections.
>
>                at
> com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.createSharingException(WSJdbc
> Connection.java:1192)
>
>                at
> com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.setAutoCommit(WSJdbcConnectio
> n.java:2620)
>
>                at
> org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager
> .store(BundleDbPersistenceManager.java:562)
>
>                ... 43 more
>
> Caused by: javax.resource.spi.SharingViolationException: DSRA9250E:
> Operation setAutoCommit is not allowed during a global transaction for
> Shareable Connections.
>
>                at
> com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.createSharingException(WSJdbc
> Connection.java:1193)
>
>                ... 45 more
>
>
>
> The FAQ/wiki page doesn't help and the mailing list archive doesn't help
> either...
>
>
>
> Thanks in advance,
>
> Xuetao Niu
>
>
>
> P.S. I expect to use mssql database to do all persistence, here is the
> configuration file I am using:
>
>
>
> <Repository>
>
>    <!--
>
>        virtual file system where the repository stores global state
>
>        (e.g. registered namespaces, custom node types, etc.)
>
>    -->
>
>    <FileSystem
> class="org.apache.jackrabbit.core.fs.db.MSSqlFileSystem">
>
>        <param name="driver" value="javax.naming.InitialContext"/>
>
>            <param name="url"
> value="java:comp/env/jdbc/RtdeDataSource"/>
>
>            <param name="schema" value="mssql"/>
>
>    </FileSystem>
>
>      <PersistenceManager
> class="org.apache.jackrabbit.core.persistence.bundle.MSSqlPersistenceMan
> ager">
>
>            <param name="driver" value="javax.naming.InitialContext"/>
>
>                  <param name="url"
> value="java:comp/env/jdbc/RtdeDataSource"/>
>
>                  <param name="schema" value="mssql"/>
>
>            <param name="externalBLOBs" value="false"/>
>
>        </PersistenceManager>
>
>    <!--
>
>        security configuration
>
>    -->
>
>    <Security appName="Jackrabbit">
>
>        <!--
>
>            access manager:
>
>            class: FQN of class implementing the AccessManager interface
>
>        -->
>
>        <AccessManager
> class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager">
>
>            <!-- <param name="config" value="${rep.home}/access.xml"/>
> -->
>
>        </AccessManager>
>
>
>
>        <LoginModule
> class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule">
>
>           <!-- anonymous user name ('anonymous' is the default value)
> -->
>
>           <param name="anonymousId" value="anonymous"/>
>
>           <!--
>
>              default user name to be used instead of the anonymous user
>
>              when no login credentials are provided (unset by default)
>
>           -->
>
>           <!-- <param name="defaultUserId" value="superuser"/> -->
>
>        </LoginModule>
>
>    </Security>
>
>
>
>    <!--
>
>        location of workspaces root directory and name of default
> workspace
>
>    -->
>
>    <Workspaces rootPath="${rep.home}/workspaces"
> defaultWorkspace="default"/>
>
>    <!--
>
>        workspace configuration template:
>
>        used to create the initial workspace if there's no workspace yet
>
>    -->
>
>    <Workspace name="${wsp.name}">
>
>        <!--
>
>            virtual file system of the workspace:
>
>            class: FQN of class implementing the FileSystem interface
>
>        -->
>
>        <FileSystem
> class="org.apache.jackrabbit.core.fs.db.MSSqlFileSystem">
>
>            <param name="driver" value="javax.naming.InitialContext"/>
>
>                  <param name="url"
> value="java:comp/env/jdbc/RtdeDataSource"/>
>
>                  <param name="schema" value="mssql"/>
>
>            <param name="schemaObjectPrefix" value="ws_"/>
>
>        </FileSystem>
>
>        <!--
>
>            persistence manager of the workspace:
>
>            class: FQN of class implementing the PersistenceManager
> interface
>
>        -->
>
>        <PersistenceManager
> class="org.apache.jackrabbit.core.persistence.bundle.MSSqlPersistenceMan
> ager">
>
>            <param name="driver" value="javax.naming.InitialContext"/>
>
>                  <param name="url"
> value="java:comp/env/jdbc/RtdeDataSource"/>
>
>                  <param name="schema" value="mssql"/>
>
>            <param name="externalBLOBs" value="false"/>
>
>            <param name="schemaObjectPrefix" value="ws_"/>
>
>            <param name="externalBLOBs" value="false"/>
>
>        </PersistenceManager>
>
>        <!--
>
>            Search index and the file system it uses.
>
>            class: FQN of class implementing the QueryHandler interface
>
>        -->
>
>        <SearchIndex
> class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
>
>            <param name="path" value="${wsp.home}/index"/>
>
>        </SearchIndex>
>
>    </Workspace>
>
>
>
>    <!--
>
>        Configures the versioning
>
>    -->
>
>    <Versioning rootPath="${rep.home}/version">
>
>        <!--
>
>            Configures the filesystem to use for versioning for the
> respective
>
>            persistence manager
>
>        -->
>
>        <FileSystem
> class="org.apache.jackrabbit.core.fs.db.MSSqlFileSystem">
>
>            <param name="driver" value="javax.naming.InitialContext"/>
>
>                  <param name="url"
> value="java:comp/env/jdbc/RtdeDataSource"/>
>
>                  <param name="schema" value="mssql"/>
>
>            <param name="schemaObjectPrefix" value="version_"/>
>
>        </FileSystem>
>
>
>
>        <!--
>
>            Configures the persistence manager to be used for persisting
> version state.
>
>            Please note that the current versioning implementation is
> based on
>
>            a 'normal' persistence manager, but this could change in
> future
>
>            implementations.
>
>        -->
>
>        <PersistenceManager
> class="org.apache.jackrabbit.core.persistence.bundle.MSSqlPersistenceMan
> ager">
>
>            <param name="driver" value="javax.naming.InitialContext"/>
>
>                  <param name="url"
> value="java:comp/env/jdbc/RtdeDataSource"/>
>
>                  <param name="schema" value="mssql"/>
>
>            <param name="schemaObjectPrefix" value="version_"/>
>
>            <param name="externalBLOBs" value="false"/>
>
>        </PersistenceManager>
>
>    </Versioning>
>
>
>
>    <!--
>
>        Search index for content that is shared repository wide
>
>        (/jcr:system tree, contains mainly versions)
>
>    -->
>
>    <SearchIndex
> class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
>
>        <param name="path" value="${rep.home}/repository/index"/>
>
>    </SearchIndex>
>
> </Repository>
>
>