mirror of
https://github.com/apache/openjpa.git
synced 2025-02-22 01:55:29 +00:00
OPENJPA-2134. Do not close Connections during prepareForPooling if ConnectionRetainMode is set to "always".
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1291900 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
cecd73b6ee
commit
c55f8469f1
@ -1156,11 +1156,14 @@ public class EntityManagerImpl
|
||||
public void prepareForPooling() {
|
||||
assertNotCloseInvoked();
|
||||
clear();
|
||||
_broker.lock(); // since this direct close path is not protected...
|
||||
try {
|
||||
_broker.getStoreManager().close();
|
||||
} finally {
|
||||
_broker.unlock();
|
||||
// Do not close connection if ConnectionRetainMode is set to Always...
|
||||
if (getConnectionRetainMode() != ConnectionRetainMode.ALWAYS) {
|
||||
_broker.lock(); // since this direct close path is not protected...
|
||||
try {
|
||||
_broker.getStoreManager().close();
|
||||
} finally {
|
||||
_broker.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user