Issue Details (XML | Word | Printable)

Key: OPENJPA-55
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: David Wisneski
Reporter: Abe White
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenJPA

Allow executeUpdate() invocations on native queries

Created: 19/Sep/06 06:24 PM   Updated: 01/Mar/07 02:20 AM
Return to search
Component/s: query
Affects Version/s: None
Fix Version/s: 0.9.7

Time Tracking:
Not Specified

Resolution Date: 01/Mar/07 02:20 AM


 Description  « Hide
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)

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
David Wisneski added a comment - 27/Jan/07 12:52 AM
we think we fixed this. We wil retest.

David Wisneski added a comment - 01/Feb/07 01:45 AM
fixed by revision 497605