JDO PersistenceManager synchronization performs close attempt after completion (if necessary; SPR-8846)

This commit is contained in:
Juergen Hoeller
2011-11-28 19:38:38 +00:00
parent db0c921313
commit 3c5e02a54a
2 changed files with 19 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -323,6 +323,11 @@ public abstract class PersistenceManagerFactoryUtils {
return this.newPersistenceManager;
}
@Override
protected boolean shouldReleaseAfterCompletion(PersistenceManagerHolder resourceHolder) {
return !resourceHolder.getPersistenceManager().isClosed();
}
@Override
protected void releaseResource(PersistenceManagerHolder resourceHolder, PersistenceManagerFactory resourceKey) {
releasePersistenceManager(resourceHolder.getPersistenceManager(), resourceKey);