Re: OpenJPA reconnect derby database issue.

2009-06-09 Thread wang yu
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

Re: OpenJPA reconnect derby database issue.

2009-06-08 Thread Michael Dick
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

Re: OpenJPA reconnect derby database issue.

2009-06-07 Thread wang yu
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

Re: OpenJPA reconnect derby database issue.

2009-06-05 Thread Michael Dick
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

OpenJPA reconnect derby database issue.

2009-06-05 Thread wang yu
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