• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Al Hobbs
  • salvin francis

version is not updated in JPA in case of named queries

Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers,

I am using openjpa 2.1.0 implementation of JPA.
Where I have entity in that have property annotated with @Version annotation.

here XXX_VERSION is column in table with datatype numeric, now when I call merge by editing entity then openjpa will do increment value from XXX_VERSION column by 1.

Above functionality as expected, working absolutely fine.
But when I used a Named queries for updating some of the columns from table then version is not getting incremented due to that if any other concurrent user doing any thing with same row from DB from session of him then version is not got incremented in XXX_VERSION column.
I have tried to pass the incremented version to update query, it giving exception saying invalid query syntax.

what could be done so that version got incremented in case update queries using Named query?

    Bookmark Topic Watch Topic
  • New Topic