This content has been marked as final.
Show 1 reply
-
1. Re: EntityNotFoundException after removing entity
pmuir Apr 13, 2008 6:20 PM (in response to javichi_fer)
Javier Ferrero wrote on Apr 10, 2008 07:50 PM:
Hi everybody!
I have one entityProcess
with a OneToMany relation with another entityKillerQuestion
as follows:@OneToMany(cascade = CascadeType.ALL, mappedBy = "processId") private List<KillerQuestion> killerQuestionCollection;
In one SFSB I oftenly refresh the process calling the following method:private void refreshProcess(){ try{ em.refresh(process); } catch (EntityNotFoundException exc){ System.out.println("EntityNotFoundException"); } }
Why do you do that? It's a pretty ugly design.
1. Is there a way to avoid the EntityNotFoundException and that the process is refreshed properly?Yes, use managed entities.
2. Is there a way to
reactivate
the transaction so that I can execute the em.find method after the EntityNotFoundException?No.