Re: EntityManager.find ClassCastException for wrong but existing id

2014-09-12 Thread olyalikov
> > On Thu, Sep 11, 2014 at 2:38 AM, olyalikov < > oleg.lyalikov@ > > wrote: > >> I did a mistake - I'm getting not ClassNotFoundException but >> ClassCastException: >> java.lang.ClassCastException: org.apache.openjpa.find.entities.Document >

Re: EntityManager.find ClassCastException for wrong but existing id

2014-09-11 Thread olyalikov
s a result of executing final Person p = em.find(Person.class, doc.getId()); All this can be found/reproduced in the project attached to the previous post. Oleg Rick Curtis wrote > Can we see the exception? > > Thanks, > Rick > > On Wed, Sep 10

EntityManager.find ClassCastException for wrong but existing id

2014-09-10 Thread olyalikov
Hello, I have base entity and 2 inheritors e.g. Person and Document. If I try to find Person entity and provide id of the Document entity I get ClassNotFoundException but it should return either null or EntityNotFoundException. If I provide just some wrong non existing id I get null. Here is link

Re: Data cache does not work in OpenJPA 2.2.2

2014-09-10 Thread olyalikov
I just wanted to post an update about the issue. We made own release of OpenJPA 2.2.2 with merged fix, we use it ~3 months and all goes well (tests ok, performance ok). So if somebody is interested, here are forked and fixed sources: https://github.com/oamp-cms/openjpa, CI job: https://buildhive.cl

Incorrect concurrent persist of ManyToOne field

2013-12-09 Thread olyalikov
Hello, In short: I have 2 entities - Person and Document, Person has a ManyToOne link to the Document. I create Document in a separate thread/entity manager, close entity manager (and so document becomes detached) and then create concurrently Person objects (in separate entity managers) setting do