openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abe White (JIRA)" <j...@apache.org>
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
                 URL: http://issues.apache.org/jira/browse/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(QueryImpl.java:355)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message