You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Udi <Sa...@gmail.com> on 2009/03/05 08:52:41 UTC

Re: EntityNotFoundException in find()

I minimized the places I get EntityNotFoundException to a single refresh
line.
I just can't figure out what the problem is:

if (!em.contains(entity))
    return;
em.refresh(entity);           ----->  EntityNotFoundException sometimes...

What do I do wrong? How can I tell that the entity is not managed anymore?
-- 
View this message in context: http://n2.nabble.com/EntityNotFoundException-in-find%28%29-tp2231065p2428016.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: EntityNotFoundException in find()

Posted by Michael Dick <mi...@gmail.com>.
Hi Udi,

Has another thread deleted or removed the entity? If only a single thread is
accessing the database you shouldn't be able to get into this situation. My
guess is that there's some other process which has deleted the row from the
database.

Could you post the version of OpenJPA that you're using (it'll show up in
the exception), might help if there was a known problem with a particular
build.

HTH,

-mike

On Thu, Mar 5, 2009 at 1:52 AM, Udi <Sa...@gmail.com> wrote:

>
> I minimized the places I get EntityNotFoundException to a single refresh
> line.
> I just can't figure out what the problem is:
>
> if (!em.contains(entity))
>    return;
> em.refresh(entity);           ----->  EntityNotFoundException sometimes...
>
> What do I do wrong? How can I tell that the entity is not managed anymore?
> --
> View this message in context:
> http://n2.nabble.com/EntityNotFoundException-in-find%28%29-tp2231065p2428016.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>
>