Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1-dev
    • Fix Version/s: 2.1-dev, 2.1
    • Component/s: Persistence and DAO
    • Labels:
      None

      Description

      I tried writing a unit test to test OJB + Spring transactions.
      To my suprise, transactions are not starting.

      In fact, Im seeing some surprising results in mysql.log
      (yes Im using InnoDB), note no transactions, and the forced autocommit

      118 Query SET autocommit=1
      117 Prepare [1] INSERT INTO FOLDER...
      117 Execute [1] INSERT INTO FOLDER...
      117 Query SET autocommit=1

      It appears that OJB repeatedly sets autocommit=1
      and
      it never starts any transactions

      Here is my unit test, which tests out a new 'fake' API addPage to the PageManager. This API is temporary to test transactional behavior:

      public void testTx() throws Exception
      {
      Folder root = pageManager.newFolder("/");
      pageManager.updateFolder(root);
      Page[] pages = new Page[3];
      pages[0] = pageManager.newPage("/test1.psml");
      pages[1] = pageManager.newPage("/test2.psml");
      pages[2] = pageManager.newPage("/test3.psml");
      try

      { pageManager.addPages(pages); }

      In addPages, I try to force a rollback:

      public int addPages(Page[] pages)
      throws JetspeedException

      { System.out.println("Adding first page"); this.updatePage(pages[0]); System.out.println("Adding second page"); this.updatePage(pages[1]); System.out.println("About to throw ex"); throw new JetspeedException("Its gonna blow captain!"); }

      Finally, add pages is enabled for a Spring tx:

      <prop key="addPages*">PROPAGATION_REQUIRED,-org.apache.jetspeed.exception.JetspeedException</prop>

      1. Chatty.zip
        66 kB
        David Sean Taylor

        Activity

        David Sean Taylor created issue -
        David Sean Taylor made changes -
        Field Original Value New Value
        Status Open [ 1 ] In Progress [ 3 ]
        David Sean Taylor made changes -
        Attachment Chatty.zip [ 12323381 ]
        David Sean Taylor made changes -
        Resolution Fixed [ 1 ]
        Status In Progress [ 3 ] Resolved [ 5 ]
        Ate Douma made changes -
        Fix Version/s 2.1 [ 12310617 ]
        Ate Douma made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            David Sean Taylor
            Reporter:
            David Sean Taylor
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development