Hi Yann,
Does your test use the same entity manager concurrently on multiple threads?
Entity managers are not thread safe by definition. If that is the case,
you could try setting openjpa.Multithreaded property to true, but you'll
likely run into other state or transaction related issues. It's best to use
a unique entity manager on each thread. If you are using separate entity
managers, could you post a failing test case and information about your
system - specifically OS and the number of CPU cores.
-Jeremy
On Tue, Nov 25, 2008 at 9:15 AM, Yann Andenmatten <
[EMAIL PROTECTED]> wrote:
> Hi,
>
>
>
> We are in the process of testing OpenJPA's performance on large volume.
> To measure it, we uses junitperf which execute simultaneously the same
> unit test in separate threads.
>
>
>
> Some time the test succeeded, some time I get this error (which excludes
> a configuration problem):
>
> 1)
> testPortfolioType(MultithreadedQueriesTest)<openjpa-1.2.0-r422266:683325
> nonfatal user error> org.apache.openjpa.persistence.ArgumentException:
> An error occurred while parsing the query filter "SELECT e FROM
> SomeEntity29 e". Error message: The name "SomeEntity29" is not a
> recognized entity or identifier. Perhaps you meant SomeEntity29, which
> is a close match. Known entity names: [SomeEntity18, SomeEntity19,
> SomeEntity16, SomeEntity17, SomeEntity14, SomeEntity15, SomeEntity12,
> SomeEntity13, SomeEntity10, SomeEntity6, SomeEntity11, SomeEntity5,
> SomeEntity4, SomeEntity3, SomeEntity2, SomeEntity1, Client,
> SomeEntity20, SomeEntity22, SomeEntity21, SomeEntity24, SomeEntity9,
> SomeEntity23, SomeEntity26, SomeEntity8, SomeEntity7, SomeEntity25,
> SomeEntity28, SomeEntity27, SomeEntity29]
>
> at
> org.apache.openjpa.kernel.exps.AbstractExpressionBuilder.parseException(
> AbstractExpressionBuilder.java:118)
>
> at
> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassMetaData(JP
> QLExpressionBuilder.java:177)
>
> [...]
>
>
>
> As you can see in this particular execution is that SomeEntity29 is not
> recognized as an entity, but it appears on the known entity names. This
> lets me think the initialization continued after the error occurs and
> before the error message is printed.
>
>
>
> I tried to create and close a dummy EntityManager as proposed in some
> thread on this mailing list:
>
> emf = Persistence.createEntityManagerFactory("myUnit", p);
>
> EntityManager em = emf.createEntityManager();
>
> em.close();
>
> Thread.sleep(5000);
>
>
>
> No success. I also tried to force the initialization of the entities by
> loading the classes:
>
> for (int i=1; i<=29; i++) {
>
> Class.forName("my.company.SomeEntity"+i);
>
> }
>
> No success too.
>
>
>
> Any idea how to unsure the proper initialization of the EntityManager
> before the first query?
>
>
>
> Yann
>
> (Occurred with openJPA 1.2.0 Sybase and Derby databases, sun jdk1.6)
>
>
> ____________________________________________________________
>
> • This email and any files transmitted with it are CONFIDENTIAL and
> intended
> solely for the use of the individual or entity to which they are
> addressed.
> • Any unauthorized copying, disclosure, or distribution of the material
> within
> this email is strictly forbidden.
> • Any views or opinions presented within this e-mail are solely those of
> the
> author and do not necessarily represent those of Odyssey Financial
> Technologies SA unless otherwise specifically stated.
> • An electronic message is not binding on its sender. Any message referring
> to
> a binding engagement must be confirmed in writing and duly signed.
> • If you have received this email in error, please notify the sender
> immediately
> and delete the original.