In terms randomness, I can think of two possibilities off the top of my head: 1. you might be using timer tasks (i.e. java.util.Timer of sth to that effect) which perform some operations on a pre-allocated EntityManager upon expiration, 2. you might be using some library with which you register callback interfaces and the library invokes your methods from a different thread. If you can tell us how you create & dispose of EntityManagers, it'll help spotting the problem.

About your pooling questions: OpenJPA does not have a built-in connection pool, but you can plug javax.sql.DataSource compliant connection pools (such as http://commons.apache.org/dbcp/) via |openjpa|.ConnectionFactory configuration. And there's no thread-pooling in JDBC layer.

Marc Siegel wrote:
Hi Gokhan,

Well we may be on the right track here.

My application is single-threaded, I never create any threads. Does
that lead to any other thoughts of where threading may intrude
periodically and seemingly randomly? Is there connection pooling /
threadpooling in the JDBC layer of openjpa?

-Marc

Reply via email to