openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abe White (JIRA)" <>
Subject [jira] Created: (OPENJPA-55) Allow executeUpdate() invocations on native queries
Date Tue, 19 Sep 2006 18:26:24 GMT
Allow executeUpdate() invocations on native queries

                 Key: OPENJPA-55
             Project: OpenJPA
          Issue Type: Improvement
          Components: query
            Reporter: Abe White
            Priority: Minor

Currently, native queries only allow you to execute via getResultList or getSingleResult.
 Also allow execution through executeUpdate().  Original report:

I have a customer who is using Kodo 4.0.1 JPA and tried to use the following line to lock
back end tables:
>     String sql = "LOCK TABLE  ...... IN EXCLUSIVE MODE";
>     Query q = em.createNativeQuery(sql);
>     q.executeUpdate();
But he got errors:
Caused by: <4|false|4.0.1> kodo.persistence.InvalidStateException: Cannot perform an
update or delete operation on select query: "LOCK TABLE ....  IN EXCLUSIVE MODE".
            at kodo.persistence.QueryImpl.executeUpdate(

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message