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

First query after server start-up created with Criteria-Api causes ClassCastException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.2.1, 2.2.2
    • None
    • criteria, jpa, query
    • None
    • Tomcat 6.x, Eclipse 3.7.2, Windowx XP

    Description

      If we are creating the first query after the server start-up with the criteria-api every following query crashes with a ClassCastException "org.apache.openjpa.util.StringId cannot be cast to com.provinzial.entity.EntityA".
      If the first query is a named-query with "normal" JPQL there is no problem using both, the named queries or the queries created by criteria-api.

      We've got an Entity-A having a one-to-many relation to Entity-B. Entity-B has to be loaded eager. The problem doesn't exist if Entity-B is loaded lazy.

      A workaround is to fire a JPQL-Query of a "dummy Entity-A" at the server start-up, but this is not a nice solution...

      Attachments

        Activity

          People

            Unassigned Unassigned
            christian_toennessen Christian Toennessen
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: