> On Thu, May 21, 2009 at 8:57 PM, Pinaki Poddar wrote: > > > > > Hi, > > If OpenJPA has understood what you told in persistence.xml, then OpenJPA > > should call > > MyDataSource.getConnection() > > when a connection is needed. > > To quickly verify call: > > OpenJPAEntityManager.getConnection(); > > > > Yes, I have confirmed that both the original instance (first start of > Tomcat) and the second instance (app reload) of MyDataSource are getting > getConnection called. It appears that the second instance is then > referencing static classes from the first start. It's the only thing I can > think of given that the field that is coming up null is static, instantiated > in the inititialization and never written to (IOW, how can it possibly be > null?). Is there any other reasonable cause for such a state?
Hi Daryl! That rings me on Tomcat clearing static variables [1] after reload, see org.apache.catalina.loader. WebappClassLoader.ENABLE_CLEAR_REFERENCES property. Maybe this explains something. Cheers, Milosz [1] http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html
