Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-2112

'Tweaks' to a (native) query are lost when running without a tx

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.7.1
    • 4.7.2
    • ejb31
    • None

    Description

      I'm trying to upgrade from 4.5.1
      In our code, we create a nativeQuery and add some hibernate specific stuff:

                  Query query = entityManager.createNativeQuery(queryString);
                  SQLQuery hibernateQuery = query.unwrap(SQLQuery.class);
                  hibernateQuery.addScalar("device_pk", new LongType());
                  query.getResultList()
      
      

      However , 4.7.1 fails on this code. Since there is no tx active (on purpose) the JtaQuery wrapper insists on creating a new Query object during getResltLIst, loosing the customization.

      Attachments

        Issue Links

          Activity

            People

              romain.manni-bucau Romain Manni-Bucau
              janssk1 gui
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: