jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Mueller (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCR-2961) Improve logging of Session.save() to trace back root cause of externally modified nodes
Date Fri, 06 May 2011 05:26:03 GMT

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

Thomas Mueller commented on JCR-2961:
-------------------------------------

It seems the more I test, the more problems I find. In some cases, SessionItemStateManager.getIdOfRootTransientNodeState
throws a NullPointerException.
I guess that means the change for JCR-2425 isn't working:

java.lang.NullPointerException: null
	at org.apache.jackrabbit.core.cache.ConcurrentCache.getSegment(ConcurrentCache.java:96) ~[classes/:na]
	at org.apache.jackrabbit.core.cache.ConcurrentCache.get(ConcurrentCache.java:122) ~[classes/:na]
	at org.apache.jackrabbit.core.state.MLRUItemStateCache.retrieve(MLRUItemStateCache.java:69)
~[classes/:na]
	at org.apache.jackrabbit.core.state.ItemStateReferenceCache.retrieve(ItemStateReferenceCache.java:139)
~[classes/:na]
	at org.apache.jackrabbit.core.state.LocalItemStateManager.getItemState(LocalItemStateManager.java:169)
~[classes/:na]
	at org.apache.jackrabbit.core.state.XAItemStateManager.getItemState(XAItemStateManager.java:260)
~[classes/:na]
	at org.apache.jackrabbit.core.state.SessionItemStateManager.getItemState(SessionItemStateManager.java:162)
~[classes/:na]
	at org.apache.jackrabbit.core.state.SessionItemStateManager.getIdOfRootTransientNodeState(SessionItemStateManager.java:520)
~[classes/:na]
	at org.apache.jackrabbit.core.session.SessionSaveOperation.perform(SessionSaveOperation.java:51)
~[classes/:na]
	at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:200) [classes/:na]
	at org.apache.jackrabbit.core.SessionImpl.perform(SessionImpl.java:360) [classes/:na]
	at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:800) [classes/:na]
	at org.apache.jackrabbit.api.Test.main(Test.java:39) [test-classes/:na]

Test case:

        Repository repository = new TransientRepository();
        Session session = repository.login(
                new SimpleCredentials("admin", "admin".toCharArray()));
        Session session2 = repository.login(
                new SimpleCredentials("admin", "admin".toCharArray()));

        boolean setProperty = false;

        try {
            if (session.getRootNode().hasNode("test")) {
                session.getRootNode().getNode("test").remove();
            }
            Node test = session.getRootNode().addNode("test");
            session.save();
            Node x = test.addNode("x");
            x.setProperty("y", 1);
            session.save();

            Node x2 = session2.getRootNode().getNode("test").getNode("x");
            if (setProperty) {
                x2.setProperty("y", 2);
                x.setProperty("y", 3);
            } else {
                x2.remove();
                x.addNode("b");
            }
            session2.save();
            session.save();


        } finally {
            session.logout();
            session2.logout();
        }

> Improve logging of Session.save() to trace back root cause of externally modified nodes
> ---------------------------------------------------------------------------------------
>
>                 Key: JCR-2961
>                 URL: https://issues.apache.org/jira/browse/JCR-2961
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>            Priority: Minor
>             Fix For: 2.3.0
>
>
> Currently it's very difficult to find the root cause of error like: javax.jcr.InvalidItemStateException:
<UUID> has been modified externally.
> To better trace back such issues, it would be nice to add DEBUG logging for the Session.save()
call.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message