OpenJPA
  1. OpenJPA
  2. OPENJPA-1753

TestMixedLockManagerLockPermutation: Timing issue determines the pass/no-pass of the test case

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.0.1, 2.1.0
    • Component/s: None
    • Labels:
      None

      Description

      This test case spawns three threads and the pass/no pass of the test cases depends on the timing.

      One example is TestMixedLockManagerFindPermutation.testFindReadPessimisticRead:
      commonFindTest(
      "testFind(Read,Commit/PessimisticRead,Rollback)",
      LockModeType.READ, Act.CommitTx, 1, null,
      LockModeType.PESSIMISTIC_READ, Act.RollbackTx, 1, null);

      If the find by the second child [Thread-8] is executed before the jdbc commit of the update statement by the first child [Thread-7], the test will fail. Attached are the trace file for the successful run and failing run.

      1. trace_success.txt
        10 kB
        Fay Wang
      2. trace_fail.txt
        12 kB
        Fay Wang

        Activity

        Hide
        Michael Dick added a comment -

        Closing issues which have been resolved for some time. If the problem persists, please reopen.

        Show
        Michael Dick added a comment - Closing issues which have been resolved for some time. If the problem persists, please reopen.
        Hide
        Albert Lee added a comment -

        Need to set postgresql.conf property max_connection >= 150, otherwise will get exception like:

        TestMixedLockManagerLockPermutation.testLockWriteRead View test details (org.apache.openjpa.persistence.lockmgr)
        <openjpa-2.1.0-SNAPSHOT-rexported fatal store error> org.apache.openjpa.util.StoreException: Cannot create PoolableConnectionFactory (FATAL: sorry, too many clients already)
        at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:102)
        at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:599)

        Show
        Albert Lee added a comment - Need to set postgresql.conf property max_connection >= 150, otherwise will get exception like: TestMixedLockManagerLockPermutation.testLockWriteRead View test details (org.apache.openjpa.persistence.lockmgr) <openjpa-2.1.0-SNAPSHOT-rexported fatal store error> org.apache.openjpa.util.StoreException: Cannot create PoolableConnectionFactory (FATAL: sorry, too many clients already) at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:102) at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:599)

          People

          • Assignee:
            Albert Lee
            Reporter:
            Fay Wang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development