jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Pfister (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-769) Unable to login with two different Credentials to same workspace in one Transaction
Date Mon, 12 Mar 2007 14:18:09 GMT

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

Dominique Pfister commented on JCR-769:
---------------------------------------

I completely agree that your scenario is a viable one. There is just one small problem: from
your logging output I deduce that there are actually two active TransactionContext instances:
one named TransactionContext@50a950a9, the other one TransactionContext@a460a46 (package names
omitted for brevity). This implies that their respective XIDs are different and this makes
it hardly detectable for JR's internal transaction manager to relate them.

As far as I understand, the "Admin" session is created by your custom AccessManager to check
whether the user represented by your normal "User" session is actually allowed to do what
he tries to. When starting a repository that will itself register in the by JNDI namespace
or in the RMI registry, a custom AccessManager will be able get a reference back to the actual
repository being queried. In the JCA case, this is probably something that is missing, because
getting an "Admin" session through JCA - and thereby creating a second transaction - looks
like overkill to me.

> 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