Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-1381

IllegalStateException on query method call after named query is created twice.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0-beta
    • kernel
    • None

    Description

      When a query method is called (e.g. setLockMode) on a named query that has been created twice, an IllegalStateException is thrown:

      Query q1 = em.createNamedQuery("xxxx");
      ,,,,
      Query q2 = em.createNamedQuery("xxxx");
      q2.setLockMode(READ);

      11078 test TRACE [Thread-4] Tests - Caught exception and continue: java.lang.IllegalStateException: Query is neither a JPQL SELECT nor a Criteria API query.
      11078 test TRACE [Thread-4] DumpStack - java.lang.IllegalStateException: Query is neither a JPQL SELECT nor a Criteria API query.
      at org.apache.openjpa.persistence.QueryImpl.assertJPQLOrCriteriaQuery(QueryImpl.java:377)
      at org.apache.openjpa.persistence.QueryImpl.setLockMode(QueryImpl.java:396)
      at org.apache.openjpa.persistence.QueryImpl.setLockMode(QueryImpl.java:1)
      at org.apache.openjpa.persistence.lockmgr.SequencedActionsTest.launchCommonSequence(SequencedActionsTest.java:409)

      Attachments

        Activity

          People

            ppoddar@apache.org Pinaki Poddar
            allee8285 Albert Lee
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: