wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes Integrity contraint on finder method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Integrity contraint on finder method" Watch "Integrity contraint on finder method" New topic
Author

Integrity contraint on finder method

Mike Firkser
Ranch Hand

Joined: Oct 21, 2003
Posts: 247



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.


Mike Firkser
Rutgers '84
Jonh Smith
Ranch Hand

Joined: Mar 18, 2010
Posts: 39
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

Joined: Oct 21, 2003
Posts: 247

Using 2.1
Jonh Smith
Ranch Hand

Joined: Mar 18, 2010
Posts: 39
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.
 
 
subject: Integrity contraint on finder method
 
Similar Threads
Tech Word Game
Using rowid in join, is it right technique?
Methods
one mock question for exception
Happy Indepandance Day(15-August)