You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Juergen Melzer (JIRA)" <ji...@apache.org> on 2009/04/18 15:01:16 UTC

[jira] Created: (JCR-2078) InvalidItemState after some rollbacks with XA Resource

InvalidItemState after some rollbacks with XA Resource
------------------------------------------------------

                 Key: JCR-2078
                 URL: https://issues.apache.org/jira/browse/JCR-2078
             Project: Jackrabbit Content Repository
          Issue Type: Bug
    Affects Versions: 1.5.4, 1.4
            Reporter: Juergen Melzer
            Priority: Critical


I modified a versionable node and do a rollback, after 3 to 10 iterations the test will fail.


Here is a simple testcase to demonstrate the situation.


import junit.framework.TestCase;
import org.apache.jackrabbit.core.RepositoryImpl;
import org.apache.jackrabbit.core.config.RepositoryConfig;
import org.springframework.core.io.ClassPathResource;
import org.springmodules.jcr.jackrabbit.support.JackRabbitUserTransaction;
import org.xml.sax.InputSource;

import javax.jcr.*;
import java.io.File;

public class NoSuchItemStateExceptionTest extends TestCase {

    private static final File TARGET = new File("target");
    private static final String REPO_HOME = "repository-lock-test";

    public void testIt2() throws Exception {

        RepositoryConfig config =
                RepositoryConfig.create(new InputSource(new ClassPathResource("repository.xml").getInputStream()),
                                        REPO_HOME);

        final Repository repository = RepositoryImpl.create(config);
        SimpleCredentials credentials = new SimpleCredentials("1", "1".toCharArray());
        Session sess = repository.login(credentials);


        for (int i = 0; i < 100; i++) {
            JackRabbitUserTransaction tx = new JackRabbitUserTransaction(sess);
            tx.begin();
            System.out.println("i=" + i);

            Node root = sess.getRootNode();
            createNode(sess, root);
            tx.rollback();
        }
    }

    void createNode(Session sess, Node root) throws RepositoryException {

        Node nodeType = root.addNode("first");
        Node n = nodeType.addNode("second");
        n.addMixin("mix:versionable");

        Node n2 = nodeType.addNode("second2");
        n2.addMixin("mix:versionable");
        sess.save();
    }
}



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


[jira] Updated: (JCR-2078) InvalidItemState after some rollbacks with XA Resource

Posted by "angela (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2078?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

angela updated JCR-2078:
------------------------

    Component/s: transactions
                 jackrabbit-core

> InvalidItemState after some rollbacks with XA Resource
> ------------------------------------------------------
>
>                 Key: JCR-2078
>                 URL: https://issues.apache.org/jira/browse/JCR-2078
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core, transactions
>    Affects Versions: 1.4, 1.5.4
>            Reporter: Juergen Melzer
>            Priority: Critical
>
> I modified a versionable node and do a rollback, after 3 to 10 iterations the test will fail.
> Here is a simple testcase to demonstrate the situation.
> import junit.framework.TestCase;
> import org.apache.jackrabbit.core.RepositoryImpl;
> import org.apache.jackrabbit.core.config.RepositoryConfig;
> import org.springframework.core.io.ClassPathResource;
> import org.springmodules.jcr.jackrabbit.support.JackRabbitUserTransaction;
> import org.xml.sax.InputSource;
> import javax.jcr.*;
> import java.io.File;
> public class NoSuchItemStateExceptionTest extends TestCase {
>     private static final File TARGET = new File("target");
>     private static final String REPO_HOME = "repository-lock-test";
>     public void testIt2() throws Exception {
>         RepositoryConfig config =
>                 RepositoryConfig.create(new InputSource(new ClassPathResource("repository.xml").getInputStream()),
>                                         REPO_HOME);
>         final Repository repository = RepositoryImpl.create(config);
>         SimpleCredentials credentials = new SimpleCredentials("1", "1".toCharArray());
>         Session sess = repository.login(credentials);
>         for (int i = 0; i < 100; i++) {
>             JackRabbitUserTransaction tx = new JackRabbitUserTransaction(sess);
>             tx.begin();
>             System.out.println("i=" + i);
>             Node root = sess.getRootNode();
>             createNode(sess, root);
>             tx.rollback();
>         }
>     }
>     void createNode(Session sess, Node root) throws RepositoryException {
>         Node nodeType = root.addNode("first");
>         Node n = nodeType.addNode("second");
>         n.addMixin("mix:versionable");
>         Node n2 = nodeType.addNode("second2");
>         n2.addMixin("mix:versionable");
>         sess.save();
>     }
> }

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


[jira] Resolved: (JCR-2078) InvalidItemState after some rollbacks with XA Resource

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2078?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting resolved JCR-2078.
--------------------------------

    Resolution: Duplicate

This got fixed in JCR-2712, so resolving as a duplicate.

> InvalidItemState after some rollbacks with XA Resource
> ------------------------------------------------------
>
>                 Key: JCR-2078
>                 URL: https://issues.apache.org/jira/browse/JCR-2078
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core, transactions
>    Affects Versions: 1.4, 1.5.4
>            Reporter: Juergen Melzer
>            Priority: Critical
>
> I modified a versionable node and do a rollback, after 3 to 10 iterations the test will fail.
> Here is a simple testcase to demonstrate the situation.
> import junit.framework.TestCase;
> import org.apache.jackrabbit.core.RepositoryImpl;
> import org.apache.jackrabbit.core.config.RepositoryConfig;
> import org.springframework.core.io.ClassPathResource;
> import org.springmodules.jcr.jackrabbit.support.JackRabbitUserTransaction;
> import org.xml.sax.InputSource;
> import javax.jcr.*;
> import java.io.File;
> public class NoSuchItemStateExceptionTest extends TestCase {
>     private static final File TARGET = new File("target");
>     private static final String REPO_HOME = "repository-lock-test";
>     public void testIt2() throws Exception {
>         RepositoryConfig config =
>                 RepositoryConfig.create(new InputSource(new ClassPathResource("repository.xml").getInputStream()),
>                                         REPO_HOME);
>         final Repository repository = RepositoryImpl.create(config);
>         SimpleCredentials credentials = new SimpleCredentials("1", "1".toCharArray());
>         Session sess = repository.login(credentials);
>         for (int i = 0; i < 100; i++) {
>             JackRabbitUserTransaction tx = new JackRabbitUserTransaction(sess);
>             tx.begin();
>             System.out.println("i=" + i);
>             Node root = sess.getRootNode();
>             createNode(sess, root);
>             tx.rollback();
>         }
>     }
>     void createNode(Session sess, Node root) throws RepositoryException {
>         Node nodeType = root.addNode("first");
>         Node n = nodeType.addNode("second");
>         n.addMixin("mix:versionable");
>         Node n2 = nodeType.addNode("second2");
>         n2.addMixin("mix:versionable");
>         sess.save();
>     }
> }

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