jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Köll (JIRA) <j...@apache.org>
Subject [jira] Commented: (JCR-769) Unable to login with two different Credentials to same workspace in one Transaction
Date Tue, 13 Mar 2007 12:59:09 GMT

    [ https://issues.apache.org/jira/browse/JCR-769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12480380
] 

Claus Köll commented on JCR-769:
--------------------------------

I have changed the code in the XASessionImpl to store the TransactionContext with the GlobalTransactionId
as Key in the txGlobal Map 
instead the whole Xid Object to get only one TransactionContext Object during the whole XATransaction
This works fine for me and i think this is the right way. 
I have traced the entire XA Transaction. 
As you will see the problem with the lock in the WorkspaceInfo Object still occurs without
my Patch !

The Log:
=2007-03-13 13:43:52,043 INFO  - XASessionImpl start for org.apache.jackrabbit.core.XASessionImpl@6bf66bf6
with Xid: {XID: formatId(57415344), gtrid_length(39), bqual_length(28), data(0000000000000006000000488d8c7348c471a220c9a781d64d29d7e7edb72842736572766572318d8c7348c471a220c9a781d64d29d7e7edb728420000004842354235)}

=2007-03-13 13:43:52,059 INFO  - XASessionImpl start flag is TMNOFLAGS 
=2007-03-13 13:43:52,090 INFO  - XASessionImpl found Transaction: null 
=2007-03-13 13:43:52,090 INFO  - XASessionImpl associate  for org.apache.jackrabbit.core.XASessionImpl@6bf66bf6
with Context: org.apache.jackrabbit.core.TransactionContext@11ec11ec 
=2007-03-13 13:43:52,106 INFO  - XASessionImpl start for org.apache.jackrabbit.core.XASessionImpl@30ac30ac
with Xid: {XID: formatId(57415344), gtrid_length(39), bqual_length(28), data(0000000000000006000000488d8c7348c471a220c9a781d64d29d7e7edb72842736572766572318d8c7348c471a220c9a781d64d29d7e7edb728420000004877407740)}

=2007-03-13 13:43:52,106 INFO  - XASessionImpl start flag is TMNOFLAGS 
=2007-03-13 13:43:52,106 INFO  - XASessionImpl found Transaction: org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,106 INFO  - XASessionImpl associate  for org.apache.jackrabbit.core.XASessionImpl@30ac30ac
with Context: org.apache.jackrabbit.core.TransactionContext@11ec11ec 
=2007-03-13 13:43:52,621 INFO  - at.gv.tirol.common.jcr.security.AccessManager.isGranted()[MESSAGE]
No AccessNodeList check for Node:*	{}2d3d89030a0c889a36853685d9d417b1.pdf	{http://www.jcp.org/jcr/1.0}content

=2007-03-13 13:43:52,621 INFO  - at.gv.tirol.common.jcr.security.AccessManager.isGranted()[MESSAGE]
No AccessNodeList check for Node:*	{}2d3d89030a0c889a36853685d9d417b1.pdf 
=2007-03-13 13:43:52,621 INFO  - at.gv.tirol.common.jcr.security.AccessManager.isGranted()[MESSAGE]
No AccessNodeList check for Node:*	{}2d3d89030a0c889a36853685d9d417b1.pdf	{http://www.jcp.org/jcr/1.0}content

=2007-03-13 13:43:52,653 INFO  - at.gv.tirol.common.jcr.security.AccessManager.isGranted()[MESSAGE]
No AccessNodeList check for Node:*	{}2d3d89030a0c889a36853685d9d417b1.pdf 
=2007-03-13 13:43:52,653 INFO  - at.gv.tirol.common.jcr.security.AccessManager.isGranted()[MESSAGE]
Access to Root Node 
=2007-03-13 13:43:52,684 INFO  - XASessionImpl end for org.apache.jackrabbit.core.XASessionImpl@30ac30ac
with Xid: {XID: formatId(57415344), gtrid_length(39), bqual_length(28), data(0000000000000006000000488d8c7348c471a220c9a781d64d29d7e7edb72842736572766572318d8c7348c471a220c9a781d64d29d7e7edb728420000004877407740)}

=2007-03-13 13:43:52,684 INFO  - XASessionImpl associate  for org.apache.jackrabbit.core.XASessionImpl@30ac30ac
with Context: null 
=2007-03-13 13:43:52,684 INFO  - XASessionImpl end for org.apache.jackrabbit.core.XASessionImpl@6bf66bf6
with Xid: {XID: formatId(57415344), gtrid_length(39), bqual_length(28), data(0000000000000006000000488d8c7348c471a220c9a781d64d29d7e7edb72842736572766572318d8c7348c471a220c9a781d64d29d7e7edb728420000004842354235)}

=2007-03-13 13:43:52,684 INFO  - XASessionImpl associate  for org.apache.jackrabbit.core.XASessionImpl@6bf66bf6
with Context: null 
=2007-03-13 13:43:52,684 INFO  - XASessionImpl prepare for org.apache.jackrabbit.core.XASessionImpl@30ac30ac
with Xid: {XID: formatId(57415344), gtrid_length(39), bqual_length(28), data(0000000000000006000000488d8c7348c471a220c9a781d64d29d7e7edb72842736572766572318d8c7348c471a220c9a781d64d29d7e7edb728420000004877407740)}

=2007-03-13 13:43:52,684 INFO  - XASessionImpl TransactionContext.prepare start 
=2007-03-13 13:43:52,684 INFO  - TransactionContext prepare beforeOperation() start on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,684 INFO  - TransactionContext prepare beforeOperation end on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,684 INFO  - TransactionContext prepare prepareResource start on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,684 INFO  - Resource is org.apache.jackrabbit.core.XAWorkspace$1@74817481

XAWorkspace prepare in XAResourceBegin lockAcquire start
=2007-03-13 13:43:52,684 INFO  - WorkspaceInfo lockAcquire() lock is already false 
XAWorkspace prepare in XAResourceBegin lockAcquire end
=2007-03-13 13:43:52,684 INFO  - TransactionContext prepare prepareResource end on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,684 INFO  - TransactionContext prepare prepareResource start on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,684 INFO  - Resource is org.apache.jackrabbit.core.state.XAItemStateManager@2ad32ad3

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare prepareResource end on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare prepareResource start on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - Resource is org.apache.jackrabbit.core.lock.XALockManager@176a176a

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare prepareResource end on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare prepareResource start on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - Resource is org.apache.jackrabbit.core.version.XAVersionManager@42bf42bf

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare prepareResource end on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare prepareResource start on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - Resource is org.apache.jackrabbit.core.XAWorkspace$2@45f945f9

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare prepareResource end on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare afterOperation start on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare afterOperation end on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare Method end onorg.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - XASessionImpl TransactionContext.prepare end 
=2007-03-13 13:43:52,715 INFO  - XASessionImpl return 0 
=2007-03-13 13:43:52,715 INFO  - XASessionImpl prepare for org.apache.jackrabbit.core.XASessionImpl@6bf66bf6
with Xid: {XID: formatId(57415344), gtrid_length(39), bqual_length(28), data(0000000000000006000000488d8c7348c471a220c9a781d64d29d7e7edb72842736572766572318d8c7348c471a220c9a781d64d29d7e7edb728420000004842354235)}

=2007-03-13 13:43:52,715 INFO  - XASessionImpl TransactionContext.prepare start 
=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare beforeOperation() start on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare beforeOperation end on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare prepareResource start on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - Resource is org.apache.jackrabbit.core.XAWorkspace$1@74817481


*** A Lock will be aquired but if we do not check if a lock is already on it a Deadlock will
occur !
XAWorkspace prepare in XAResourceBegin lockAcquire start
=2007-03-13 13:43:52,715 INFO  - WorkspaceInfo lockAcquire() lock is already true 
XAWorkspace prepare in XAResourceBegin lockAcquire end

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare prepareResource end on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare prepareResource start on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - Resource is org.apache.jackrabbit.core.state.XAItemStateManager@2ad32ad3

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare prepareResource end on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare prepareResource start on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - Resource is org.apache.jackrabbit.core.lock.XALockManager@176a176a

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare prepareResource end on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare prepareResource start on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - Resource is org.apache.jackrabbit.core.version.XAVersionManager@42bf42bf

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare prepareResource end on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare prepareResource start on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - Resource is org.apache.jackrabbit.core.XAWorkspace$2@45f945f9

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare prepareResource end on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare afterOperation start on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare afterOperation end on org.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - TransactionContext prepare Method end onorg.apache.jackrabbit.core.TransactionContext@11ec11ec

=2007-03-13 13:43:52,715 INFO  - XASessionImpl TransactionContext.prepare end 
=2007-03-13 13:43:52,715 INFO  - XASessionImpl return 0 
=2007-03-13 13:43:52,731 INFO  - XASessionImpl commit for org.apache.jackrabbit.core.XASessionImpl@6bf66bf6
with Xid: {XID: formatId(57415344), gtrid_length(39), bqual_length(28), data(0000000000000006000000488d8c7348c471a220c9a781d64d29d7e7edb72842736572766572318d8c7348c471a220c9a781d64d29d7e7edb728420000004842354235)}

=2007-03-13 13:43:52,731 INFO  - XASessionImpl commit for org.apache.jackrabbit.core.XASessionImpl@30ac30ac
with Xid: {XID: formatId(57415344), gtrid_length(39), bqual_length(28), data(0000000000000006000000488d8c7348c471a220c9a781d64d29d7e7edb72842736572766572318d8c7348c471a220c9a781d64d29d7e7edb728420000004877407740)}


The next Problem is now that the commit Method from the first Session will delete the TransactionContext
from the Cache and this is very bad because the second Session
will not find the TransactionContext in the Cache in its commit Method, so a XAException(XAException.XAER_NOTA)
will occur.

I hope this stack will help to understand the problem.

> Unable to login with two different Credentials to same workspace in one Transaction
> -----------------------------------------------------------------------------------
>
>                 Key: JCR-769
>                 URL: https://issues.apache.org/jira/browse/JCR-769
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jca
>    Affects Versions: 1.2.1
>         Environment: Websphere 5.1.1 J2C Adapter
>            Reporter: Claus Köll
>         Attachments: patch.txt, stacktrace.txt
>
>
> I'm using the Jackrabbit 1.2.1 JCA adapter and trying to access in a SessionBean-Method
with Container Transaction a Workspace with 2 different Credentials. 
> The Method takes about 400ms to finish but no commit on TransactionContextr occurs (Debugging
..) only the prepare was called 2 times .
> The Container hangs on the PostInvoke Method about 5 seconds and then i get a "javax.transaction.xa.XAException"

> with the Warn Message: Transaction rolled back because timeout expired
> The code ..
> Context ctx = new InitialContext(); 
> Repository repository = (Repository) ctx.lookup("java:comp/env/jackrabbit"); 
> Credentials credentials = new SimpleCredentials("user1", "password1".toCharArray());

> Credentials credentials2 = new SimpleCredentials("user2", "password2".toCharArray());

> Session session1 = repository.login(credentials, "default"); 
> Session session2 = repository.login(credentials2, "default"); 
> Session1 adds a node to the workspace .. and with the session2 i do nothing except the
login !
> If i make no second login the Method works fine.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message