mirror of https://github.com/apache/openjpa.git
OPENJPA-122 Added check for methods that require the EntityManager to be open but where the Broker would throw a different exception
git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@502325 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
11e3835d5f
commit
862cd158ed
|
@ -469,6 +469,7 @@ public class EntityManagerImpl
|
||||||
|
|
||||||
public void flush() {
|
public void flush() {
|
||||||
assertNotCloseInvoked();
|
assertNotCloseInvoked();
|
||||||
|
_broker.assertOpen();
|
||||||
_broker.assertActiveTransaction();
|
_broker.assertActiveTransaction();
|
||||||
_broker.flush();
|
_broker.flush();
|
||||||
}
|
}
|
||||||
|
@ -761,6 +762,7 @@ public class EntityManagerImpl
|
||||||
|
|
||||||
public OpenJPAQuery createNamedQuery(String name) {
|
public OpenJPAQuery createNamedQuery(String name) {
|
||||||
assertNotCloseInvoked();
|
assertNotCloseInvoked();
|
||||||
|
_broker.assertOpen();
|
||||||
try {
|
try {
|
||||||
QueryMetaData meta = _broker.getConfiguration().
|
QueryMetaData meta = _broker.getConfiguration().
|
||||||
getMetaDataRepositoryInstance().getQueryMetaData(null, name,
|
getMetaDataRepositoryInstance().getQueryMetaData(null, name,
|
||||||
|
@ -809,12 +811,14 @@ public class EntityManagerImpl
|
||||||
|
|
||||||
public void setFlushMode(FlushModeType flushMode) {
|
public void setFlushMode(FlushModeType flushMode) {
|
||||||
assertNotCloseInvoked();
|
assertNotCloseInvoked();
|
||||||
|
_broker.assertOpen();
|
||||||
_broker.getFetchConfiguration().setFlushBeforeQueries
|
_broker.getFetchConfiguration().setFlushBeforeQueries
|
||||||
(toFlushBeforeQueries(flushMode));
|
(toFlushBeforeQueries(flushMode));
|
||||||
}
|
}
|
||||||
|
|
||||||
public FlushModeType getFlushMode() {
|
public FlushModeType getFlushMode() {
|
||||||
assertNotCloseInvoked();
|
assertNotCloseInvoked();
|
||||||
|
_broker.assertOpen();
|
||||||
return fromFlushBeforeQueries(_broker.getFetchConfiguration().
|
return fromFlushBeforeQueries(_broker.getFetchConfiguration().
|
||||||
getFlushBeforeQueries());
|
getFlushBeforeQueries());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue