Hi Mike,
Thank you for your professional explanation.
I found this issue was nothing to do with Spring. The root cause is I
cache the EntityManager in some complicated scenarios.
And I also found some configuration items related with cache will
affect this case also.
Thank you again.
Cheers,
Yu Wa
Hi Yu Wang,
I'm not sure how to configure Spring to not cache the EntityManager. My
guess is that Spring would cache an EntityManager for the lifetime of a
transaction and then close it at the end of the tran. The best reference I
could find is here [1].
Using an entirely new EntityManagerFactory
Hi Mike,
Following is how I close cache:
Your concern is spring cache the EntityManager, right? How can I avoid
this? Should I use a brand new entityManagerFactory?
Regards,
Yu
Hi Yu Wang,
It sounds like someone is maintaining a pool of EntityManagers. The
assertOpen method isn't checking Derby, it's concerned with the state of the
EntityManager itself.
How did you close the cache of OpenJPA EntityManagers? I have very little
experience with Spring, but the stack makes
Hello,
My application uses Tomcat6,derby,spring and OpenJPA 1.20.
My case is stopping derby database and restarting it. And I found even
if I catch the database connection broken exception and create an new
EntityManager successfully after derby restarts, the following
exception stack will be print