Community
Participate
Working Groups
By default, eclipselink.persistence-context.close-on-commit end-up to be false, so workaroud is to set it to true in persistence.xml When eclipselink.persistence-context.close-on-commit is false, UnitOfWork so also ClientSession is not cleanup at the end of the rollback/commit via the JTA callback. Not cleaning up ClientSession means leak of JDBC connection. Extract from: http://fisheye2.atlassian.com/browse/~raw,r=1257/eclipselink/trunk/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/transaction/AbstractSynchronizationListener.java public void afterCompletion(Object status) { ... // Clean up by releasing the uow and client session if (uow.shouldResumeUnitOfWorkOnTransactionCompletion() && getTransactionController().canMergeUnitOfWork_impl(status)){ uow.synchronizeAndResume(); uow.setSynchronized(false); }else{ uow.release(); // Release the session explicitly if (getSession().isClientSession() || (getSession().isSessionBroker() && ((SessionBroker)getSession()).isClientSessionBroker())) { getSession().release(); } }
Setting target and priority. See the following page for details of what these settings mean. http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
JTA connection is not leaked, it's released by getSession().releaseJTSConnection();
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink