Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization forum!
  • 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 ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Integrity contraint on finder method

 
Ranch Hand
Posts: 249
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Has anybody seen anything like this. I'm getting the following exception:

EJB Exception:: javax.ejb.EJBException: nested exception is: java.sql.BatchUpdateException: ORA-02291: integrity constraint (SCHEMA.FK_PADDR_ID) violated - parent key not found



The perplexing thing is this is in a finder method, so why the integrity contraint.
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
are you using 2.1 ? if so, is it possible that your container is flushing any updates made in the same transaction, before the finder method ?

is this using 3.0 with jpa ? if so is there any code before the find that may force the jpa provider to flush (partially or totally) the persistence context so that the find may be satisfied (which you can confirm by activating the verbose sql trace generated by your jpa provider).
 
Mike Firkser
Ranch Hand
Posts: 249
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using 2.1
 
Jonh Smith
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if possible, i suggest that you try commenting out the call to the finder method and just finish the transaction (by returning from the calling method). check that the problem remains. this would indicate that there is something wrong with the way your application is modifying the data.
 
Don't mess with me you fool! I'm cooking with gas! Here, read this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic