Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Integrity contraint on finder method

 
Mike Firkser
Ranch Hand
Posts: 249
Java Oracle PHP
  • Mark post as helpful
  • send pies
  • 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.
 
Jonh Smith
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • 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
Java Oracle PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using 2.1
 
Jonh Smith
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic