Hello, I'm facing an issue with OpenJPA 2.1 as shipped with IBM WebSphere 8. Our system uses JPA solely for reading the data. Updating and Deleting of data is done by a backend system. My problem is, that after a removal of a row initiated by the backend system, a subsequent call to a typed query will throw a EntityNotFoundException on a tuple query when calling getResultList(). This is weird, as the method getResultList() does NOT include this exception in the list of exceptions it may throw.
The exception reads: <openjpa-2.1.2-SNAPSHOT-r422266:1333100 nonfatal store error> org.apache.openjpa.persistence.EntityNotFoundException: Die Instanz "2256570 [org.apache.openjpa.util.LongId]" ist nicht im Datenspeicher vorhanden. FailedObject: 2256570 [java.lang.Long] What am I supposed to do here? A subsequent call to getResultList() results in the same error. The entity manager is EJB based in Extended Mode. I do not want to close it as I might loose the lazy binding functionality used within the application. Is there a way to simply retrieve the current database state and forget about all externally modified entities? I'm not aware that this ever happend directly at 'getResultList()'. I'm normally refreshing all objects after retrieval and I'm aware that refresh() may throw EntityNotFoundException. In that case I simply remove the entity from the list. Thank you for your help, Heiko If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.