• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic