Change EntityManagerImpl.assertOpen to EntityManagerImpl.assertNotCloseInvoked

to more accurately reflect the purpose of the method.  Fix several instances
where we were relying on the method to actually check whether the underlying
broker was open.



git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@501468 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
A. Abram White 2007-01-30 16:56:13 +00:00
parent 17c6580e4c
commit 372e899981
4 changed files with 132 additions and 126 deletions

View File

@ -88,6 +88,7 @@ public class ExtentImpl
}
public void setIgnoreChanges(boolean ignoreChanges) {
_broker.assertOpen();
_ignore = ignoreChanges;
}

View File

@ -95,7 +95,7 @@ public class EntityManagerImpl
public Interaction createInteraction()
throws ResourceException {
assertOpen();
assertNotCloseInvoked();
return _broker.createInteraction();
}
@ -118,7 +118,7 @@ public class EntityManagerImpl
}
public FetchPlan getFetchPlan() {
assertOpen();
assertNotCloseInvoked();
_broker.lock();
try {
if (_fetch == null)
@ -147,7 +147,7 @@ public class EntityManagerImpl
}
public void setSyncWithManagedTransactions(boolean sync) {
assertOpen();
assertNotCloseInvoked();
_broker.setSyncWithManagedTransactions(sync);
}
@ -168,7 +168,7 @@ public class EntityManagerImpl
}
public void setMultithreaded(boolean multithreaded) {
assertOpen();
assertNotCloseInvoked();
_broker.setMultithreaded(multithreaded);
}
@ -177,7 +177,7 @@ public class EntityManagerImpl
}
public void setIgnoreChanges(boolean val) {
assertOpen();
assertNotCloseInvoked();
_broker.setIgnoreChanges(val);
}
@ -186,7 +186,7 @@ public class EntityManagerImpl
}
public void setNontransactionalRead(boolean val) {
assertOpen();
assertNotCloseInvoked();
_broker.setNontransactionalRead(val);
}
@ -195,7 +195,7 @@ public class EntityManagerImpl
}
public void setNontransactionalWrite(boolean val) {
assertOpen();
assertNotCloseInvoked();
_broker.setNontransactionalWrite(val);
}
@ -204,7 +204,7 @@ public class EntityManagerImpl
}
public void setOptimistic(boolean val) {
assertOpen();
assertNotCloseInvoked();
_broker.setOptimistic(val);
}
@ -213,7 +213,7 @@ public class EntityManagerImpl
}
public void setRestoreState(int val) {
assertOpen();
assertNotCloseInvoked();
_broker.setRestoreState(val);
}
@ -222,7 +222,7 @@ public class EntityManagerImpl
}
public void setRetainState(boolean val) {
assertOpen();
assertNotCloseInvoked();
_broker.setRetainState(val);
}
@ -231,7 +231,7 @@ public class EntityManagerImpl
}
public void setAutoClear(int val) {
assertOpen();
assertNotCloseInvoked();
_broker.setAutoClear(val);
}
@ -240,7 +240,7 @@ public class EntityManagerImpl
}
public void setDetachState(int mode) {
assertOpen();
assertNotCloseInvoked();
_broker.setDetachState(mode);
}
@ -249,12 +249,12 @@ public class EntityManagerImpl
}
public void setAutoDetach(int flags) {
assertOpen();
assertNotCloseInvoked();
_broker.setAutoDetach(flags);
}
public void setAutoDetach(int flag, boolean on) {
assertOpen();
assertNotCloseInvoked();
_broker.setAutoDetach(flag, on);
}
@ -263,7 +263,7 @@ public class EntityManagerImpl
}
public void setEvictFromStoreCache(boolean evict) {
assertOpen();
assertNotCloseInvoked();
_broker.setEvictFromDataCache(evict);
}
@ -272,7 +272,7 @@ public class EntityManagerImpl
}
public void setPopulateStoreCache(boolean cache) {
assertOpen();
assertNotCloseInvoked();
_broker.setPopulateDataCache(cache);
}
@ -281,7 +281,7 @@ public class EntityManagerImpl
}
public void setLargeTransaction(boolean largeTransaction) {
assertOpen();
assertNotCloseInvoked();
_broker.setLargeTransaction(largeTransaction);
}
@ -290,17 +290,17 @@ public class EntityManagerImpl
}
public Object putUserObject(Object key, Object val) {
assertOpen();
assertNotCloseInvoked();
return _broker.putUserObject(key, val);
}
public void addTransactionListener(Object listener) {
assertOpen();
assertNotCloseInvoked();
_broker.addTransactionListener(listener);
}
public void removeTransactionListener(Object listener) {
assertOpen();
assertNotCloseInvoked();
_broker.removeTransactionListener(listener);
}
@ -309,17 +309,17 @@ public class EntityManagerImpl
}
public void setTransactionListenerCallbackMode(int mode) {
assertOpen();
assertNotCloseInvoked();
_broker.setTransactionListenerCallbackMode(mode);
}
public void addLifecycleListener(Object listener, Class... classes) {
assertOpen();
assertNotCloseInvoked();
_broker.addLifecycleListener(listener, classes);
}
public void removeLifecycleListener(Object listener) {
assertOpen();
assertNotCloseInvoked();
_broker.removeLifecycleListener(listener);
}
@ -328,20 +328,20 @@ public class EntityManagerImpl
}
public void setLifecycleListenerCallbackMode(int mode) {
assertOpen();
assertNotCloseInvoked();
_broker.setLifecycleListenerCallbackMode(mode);
}
@SuppressWarnings("unchecked")
public <T> T getReference(Class<T> cls, Object oid) {
assertOpen();
assertNotCloseInvoked();
oid = _broker.newObjectId(cls, oid);
return (T) _broker.find(oid, false, this);
}
@SuppressWarnings("unchecked")
public <T> T find(Class<T> cls, Object oid) {
assertOpen();
assertNotCloseInvoked();
oid = _broker.newObjectId(cls, oid);
return (T) _broker.find(oid, true, this);
}
@ -356,7 +356,7 @@ public class EntityManagerImpl
@SuppressWarnings("unchecked")
public <T> Collection<T> findAll(final Class<T> cls, Collection oids) {
assertOpen();
assertNotCloseInvoked();
Object[] objs = _broker.findAll(oids, true, new FindCallbacks() {
public Object processArgument(Object oid) {
return _broker.newObjectId(cls, oid);
@ -371,12 +371,12 @@ public class EntityManagerImpl
@SuppressWarnings("unchecked")
public <T> T findCached(Class<T> cls, Object oid) {
assertOpen();
assertNotCloseInvoked();
return (T) _broker.findCached(_broker.newObjectId(cls, oid), this);
}
public Class getObjectIdClass(Class cls) {
assertOpen();
assertNotCloseInvoked();
if (cls == null)
return null;
return OpenJPAPersistence.fromOpenJPAObjectIdClass
@ -391,7 +391,7 @@ public class EntityManagerImpl
}
public void joinTransaction() {
assertOpen();
assertNotCloseInvoked();
if (!_broker.syncWithManagedTransaction())
throw new TransactionRequiredException(_loc.get
("no-managed-trans"), null, null, false);
@ -443,43 +443,43 @@ public class EntityManagerImpl
}
public void setSavepoint(String name) {
assertOpen();
assertNotCloseInvoked();
_broker.setSavepoint(name);
}
public void rollbackToSavepoint() {
assertOpen();
assertNotCloseInvoked();
_broker.rollbackToSavepoint();
}
public void rollbackToSavepoint(String name) {
assertOpen();
assertNotCloseInvoked();
_broker.rollbackToSavepoint(name);
}
public void releaseSavepoint() {
assertOpen();
assertNotCloseInvoked();
_broker.releaseSavepoint();
}
public void releaseSavepoint(String name) {
assertOpen();
assertNotCloseInvoked();
_broker.releaseSavepoint(name);
}
public void flush() {
assertOpen();
assertNotCloseInvoked();
_broker.assertActiveTransaction();
_broker.flush();
}
public void preFlush() {
assertOpen();
assertNotCloseInvoked();
_broker.preFlush();
}
public void validateChanges() {
assertOpen();
assertNotCloseInvoked();
_broker.validateChanges();
}
@ -496,7 +496,7 @@ public class EntityManagerImpl
}
public boolean contains(Object entity) {
assertOpen();
assertNotCloseInvoked();
if (entity == null)
return false;
OpenJPAStateManager sm = _broker.getStateManager(entity);
@ -521,7 +521,7 @@ public class EntityManagerImpl
}
public void persist(Object entity) {
assertOpen();
assertNotCloseInvoked();
_broker.persist(entity, this);
}
@ -530,12 +530,12 @@ public class EntityManagerImpl
}
public void persistAll(Collection entities) {
assertOpen();
assertNotCloseInvoked();
_broker.persistAll(entities, this);
}
public void remove(Object entity) {
assertOpen();
assertNotCloseInvoked();
_broker.delete(entity, this);
}
@ -544,17 +544,17 @@ public class EntityManagerImpl
}
public void removeAll(Collection entities) {
assertOpen();
assertNotCloseInvoked();
_broker.deleteAll(entities, this);
}
public void release(Object entity) {
assertOpen();
assertNotCloseInvoked();
_broker.release(entity, this);
}
public void releaseAll(Collection entities) {
assertOpen();
assertNotCloseInvoked();
_broker.releaseAll(entities, this);
}
@ -563,19 +563,19 @@ public class EntityManagerImpl
}
public void refresh(Object entity) {
assertOpen();
assertNotCloseInvoked();
_broker.assertWriteOperation();
_broker.refresh(entity, this);
}
public void refreshAll() {
assertOpen();
assertNotCloseInvoked();
_broker.assertWriteOperation();
_broker.refreshAll(_broker.getTransactionalObjects(), this);
}
public void refreshAll(Collection entities) {
assertOpen();
assertNotCloseInvoked();
_broker.assertWriteOperation();
_broker.refreshAll(entities, this);
}
@ -585,12 +585,12 @@ public class EntityManagerImpl
}
public void retrieve(Object entity) {
assertOpen();
assertNotCloseInvoked();
_broker.retrieve(entity, true, this);
}
public void retrieveAll(Collection entities) {
assertOpen();
assertNotCloseInvoked();
_broker.retrieveAll(entities, true, this);
}
@ -599,12 +599,12 @@ public class EntityManagerImpl
}
public void evict(Object entity) {
assertOpen();
assertNotCloseInvoked();
_broker.evict(entity, this);
}
public void evictAll(Collection entities) {
assertOpen();
assertNotCloseInvoked();
_broker.evictAll(entities, this);
}
@ -613,39 +613,39 @@ public class EntityManagerImpl
}
public void evictAll() {
assertOpen();
assertNotCloseInvoked();
_broker.evictAll(this);
}
public void evictAll(Class cls) {
assertOpen();
assertNotCloseInvoked();
_broker.evictAll(_broker.newExtent(cls, true), this);
}
public void evictAll(Extent extent) {
assertOpen();
assertNotCloseInvoked();
_broker.evictAll(extent.getDelegate(), this);
}
@SuppressWarnings("unchecked")
public <T> T detach(T entity) {
assertOpen();
assertNotCloseInvoked();
return (T) _broker.detach(entity, this);
}
public Object[] detachAll(Object... entities) {
assertOpen();
assertNotCloseInvoked();
return _broker.detachAll(Arrays.asList(entities), this);
}
public Collection detachAll(Collection entities) {
assertOpen();
assertNotCloseInvoked();
return Arrays.asList(_broker.detachAll(entities, this));
}
@SuppressWarnings("unchecked")
public <T> T merge(T entity) {
assertOpen();
assertNotCloseInvoked();
return (T) _broker.attach(entity, true, this);
}
@ -656,42 +656,42 @@ public class EntityManagerImpl
}
public Collection mergeAll(Collection entities) {
assertOpen();
assertNotCloseInvoked();
return Arrays.asList(_broker.attachAll(entities, true, this));
}
public void transactional(Object entity, boolean updateVersion) {
assertOpen();
assertNotCloseInvoked();
_broker.transactional(entity, updateVersion, this);
}
public void transactionalAll(Collection objs, boolean updateVersion) {
assertOpen();
assertNotCloseInvoked();
_broker.transactionalAll(objs, updateVersion, this);
}
public void transactionalAll(Object[] objs, boolean updateVersion) {
assertOpen();
assertNotCloseInvoked();
_broker.transactionalAll(Arrays.asList(objs), updateVersion, this);
}
public void nontransactional(Object entity) {
assertOpen();
assertNotCloseInvoked();
_broker.nontransactional(entity, this);
}
public void nontransactionalAll(Collection objs) {
assertOpen();
assertNotCloseInvoked();
_broker.nontransactionalAll(objs, this);
}
public void nontransactionalAll(Object[] objs) {
assertOpen();
assertNotCloseInvoked();
_broker.nontransactionalAll(Arrays.asList(objs), this);
}
public Generator getNamedGenerator(String name) {
assertOpen();
assertNotCloseInvoked();
try {
SequenceMetaData meta = _broker.getConfiguration().
getMetaDataRepositoryInstance().getSequenceMetaData(name,
@ -704,7 +704,7 @@ public class EntityManagerImpl
}
public Generator getIdGenerator(Class forClass) {
assertOpen();
assertNotCloseInvoked();
try {
ClassMetaData meta = _broker.getConfiguration().
getMetaDataRepositoryInstance().getMetaData(forClass,
@ -718,7 +718,7 @@ public class EntityManagerImpl
}
public Generator getFieldGenerator(Class forClass, String fieldName) {
assertOpen();
assertNotCloseInvoked();
try {
ClassMetaData meta = _broker.getConfiguration().
getMetaDataRepositoryInstance().getMetaData(forClass,
@ -737,7 +737,7 @@ public class EntityManagerImpl
}
public <T> Extent<T> createExtent(Class<T> cls, boolean subclasses) {
assertOpen();
assertNotCloseInvoked();
return new ExtentImpl<T>(this, _broker.newExtent(cls, subclasses));
}
@ -746,21 +746,21 @@ public class EntityManagerImpl
}
public OpenJPAQuery createQuery(String language, String query) {
assertOpen();
assertNotCloseInvoked();
return new QueryImpl(this, _broker.newQuery(language, query));
}
public OpenJPAQuery createQuery(Query query) {
if (query == null)
return createQuery((String) null);
assertOpen();
assertNotCloseInvoked();
org.apache.openjpa.kernel.Query q = ((QueryImpl) query).getDelegate();
return new QueryImpl(this, _broker.newQuery(q.getLanguage(),
q));
}
public OpenJPAQuery createNamedQuery(String name) {
assertOpen();
assertNotCloseInvoked();
try {
QueryMetaData meta = _broker.getConfiguration().
getMetaDataRepositoryInstance().getQueryMetaData(null, name,
@ -791,7 +791,7 @@ public class EntityManagerImpl
}
public OpenJPAQuery createNativeQuery(String query, String mappingName) {
assertOpen();
assertNotCloseInvoked();
validateSQL(query);
org.apache.openjpa.kernel.Query kernelQuery = _broker.newQuery(
QueryLanguages.LANG_SQL, query);
@ -808,13 +808,13 @@ public class EntityManagerImpl
}
public void setFlushMode(FlushModeType flushMode) {
assertOpen();
assertNotCloseInvoked();
_broker.getFetchConfiguration().setFlushBeforeQueries
(toFlushBeforeQueries(flushMode));
}
public FlushModeType getFlushMode() {
assertOpen();
assertNotCloseInvoked();
return fromFlushBeforeQueries(_broker.getFetchConfiguration().
getFlushBeforeQueries());
}
@ -848,42 +848,43 @@ public class EntityManagerImpl
}
public void clear() {
assertOpen();
assertNotCloseInvoked();
_broker.detachAll(this);
}
public Object getDelegate() {
_broker.assertOpen();
assertNotCloseInvoked();
return this;
}
public LockModeType getLockMode(Object entity) {
assertOpen();
assertNotCloseInvoked();
return fromLockLevel(_broker.getLockLevel(entity));
}
public void lock(Object entity, LockModeType mode) {
assertOpen();
assertNotCloseInvoked();
_broker.lock(entity, toLockLevel(mode), -1, this);
}
public void lock(Object entity) {
assertOpen();
assertNotCloseInvoked();
_broker.lock(entity, this);
}
public void lock(Object entity, LockModeType mode, int timeout) {
assertOpen();
assertNotCloseInvoked();
_broker.lock(entity, toLockLevel(mode), timeout, this);
}
public void lockAll(Collection entities) {
assertOpen();
assertNotCloseInvoked();
_broker.lockAll(entities, this);
}
public void lockAll(Collection entities, LockModeType mode, int timeout) {
assertOpen();
assertNotCloseInvoked();
_broker.lockAll(entities, toLockLevel(mode), timeout, this);
}
@ -948,12 +949,12 @@ public class EntityManagerImpl
}
public void setOrderDirtyObjects(boolean order) {
assertOpen();
assertNotCloseInvoked();
_broker.setOrderDirtyObjects(order);
}
public void dirtyClass(Class cls) {
assertOpen();
assertNotCloseInvoked();
_broker.dirtyType(cls);
}
@ -973,12 +974,12 @@ public class EntityManagerImpl
}
public <T> T createInstance(Class<T> cls) {
assertOpen();
assertNotCloseInvoked();
return (T) _broker.newInstance(cls);
}
public void close() {
assertOpen();
assertNotCloseInvoked();
_broker.close();
}
@ -987,7 +988,7 @@ public class EntityManagerImpl
}
public void dirty(Object o, String field) {
assertOpen();
assertNotCloseInvoked();
OpenJPAStateManager sm = _broker.getStateManager(o);
try {
if (sm != null)
@ -998,51 +999,52 @@ public class EntityManagerImpl
}
public Object getObjectId(Object o) {
assertOpen();
assertNotCloseInvoked();
return OpenJPAPersistence.fromOpenJPAObjectId(_broker.getObjectId(o));
}
public boolean isDirty(Object o) {
assertOpen();
assertNotCloseInvoked();
return _broker.isDirty(o);
}
public boolean isTransactional(Object o) {
assertOpen();
assertNotCloseInvoked();
return _broker.isTransactional(o);
}
public boolean isPersistent(Object o) {
assertOpen();
assertNotCloseInvoked();
return _broker.isPersistent(o);
}
public boolean isNewlyPersistent(Object o) {
assertOpen();
assertNotCloseInvoked();
return _broker.isNew(o);
}
public boolean isRemoved(Object o) {
assertOpen();
assertNotCloseInvoked();
return _broker.isDeleted(o);
}
public boolean isDetached(Object entity) {
assertOpen();
assertNotCloseInvoked();
return _broker.isDetached(entity);
}
public Object getVersion(Object o) {
assertOpen();
assertNotCloseInvoked();
return _broker.getVersion(o);
}
/**
* Throw appropriate exception if entity manager is closed.
* Throw appropriate exception if close has been invoked but the broker
* is still open. We test only for this because if the broker is already
* closed, it will throw its own more informative exception when we
* delegate the pending operation to it.
*/
void assertOpen() {
// only throw when broker wouldn't throw anyway, because we prefer
// the broker's more detailed exception when available
void assertNotCloseInvoked() {
if (!_broker.isClosed() && _broker.isCloseInvoked())
throw new InvalidStateException(_loc.get("close-invoked"), null,
null, true);

View File

@ -61,7 +61,7 @@ public class ExtentImpl<T>
}
public FetchPlan getFetchPlan() {
_em.assertOpen();
_em.assertNotCloseInvoked();
_extent.lock();
try {
if (_fetch == null)
@ -79,17 +79,17 @@ public class ExtentImpl<T>
}
public void setIgnoreChanges(boolean ignoreChanges) {
_em.assertOpen();
_em.assertNotCloseInvoked();
_extent.setIgnoreChanges(ignoreChanges);
}
public List<T> list() {
_em.assertOpen();
_em.assertNotCloseInvoked();
return _extent.list();
}
public Iterator<T> iterator() {
_em.assertOpen();
_em.assertNotCloseInvoked();
return _extent.iterator();
}

View File

@ -91,7 +91,7 @@ public class QueryImpl
}
public FetchPlan getFetchPlan() {
_em.assertOpen();
_em.assertNotCloseInvoked();
_query.assertNotSerialized();
_query.lock();
try {
@ -114,31 +114,31 @@ public class QueryImpl
}
public OpenJPAQuery setIgnoreChanges(boolean ignore) {
_em.assertOpen();
_em.assertNotCloseInvoked();
_query.setIgnoreChanges(ignore);
return this;
}
public OpenJPAQuery addFilterListener(FilterListener listener) {
_em.assertOpen();
_em.assertNotCloseInvoked();
_query.addFilterListener(listener);
return this;
}
public OpenJPAQuery removeFilterListener(FilterListener listener) {
_em.assertOpen();
_em.assertNotCloseInvoked();
_query.removeFilterListener(listener);
return this;
}
public OpenJPAQuery addAggregateListener(AggregateListener listener) {
_em.assertOpen();
_em.assertNotCloseInvoked();
_query.addAggregateListener(listener);
return this;
}
public OpenJPAQuery removeAggregateListener(AggregateListener listener) {
_em.assertOpen();
_em.assertNotCloseInvoked();
_query.removeAggregateListener(listener);
return this;
}
@ -148,7 +148,7 @@ public class QueryImpl
}
public OpenJPAQuery setCandidateCollection(Collection coll) {
_em.assertOpen();
_em.assertNotCloseInvoked();
_query.setCandidateCollection(coll);
return this;
}
@ -161,7 +161,7 @@ public class QueryImpl
}
public OpenJPAQuery setResultClass(Class cls) {
_em.assertOpen();
_em.assertNotCloseInvoked();
if (OpenJPAPersistence.isManagedType(_em, cls))
_query.setCandidateType(cls, true);
else
@ -174,7 +174,7 @@ public class QueryImpl
}
public OpenJPAQuery setSubclasses(boolean subs) {
_em.assertOpen();
_em.assertNotCloseInvoked();
Class cls = _query.getCandidateType();
_query.setCandidateExtent(_query.getBroker().newExtent(cls, subs));
return this;
@ -185,7 +185,7 @@ public class QueryImpl
}
public OpenJPAQuery setFirstResult(int startPosition) {
_em.assertOpen();
_em.assertNotCloseInvoked();
_query.setRange(startPosition, _query.getEndRange());
return this;
}
@ -195,7 +195,7 @@ public class QueryImpl
}
public OpenJPAQuery setMaxResults(int max) {
_em.assertOpen();
_em.assertNotCloseInvoked();
long start = _query.getStartRange();
if (max == Integer.MAX_VALUE)
_query.setRange(start, Long.MAX_VALUE);
@ -205,7 +205,7 @@ public class QueryImpl
}
public OpenJPAQuery compile() {
_em.assertOpen();
_em.assertNotCloseInvoked();
_query.compile();
return this;
}
@ -260,7 +260,7 @@ public class QueryImpl
}
public List getResultList() {
_em.assertOpen();
_em.assertNotCloseInvoked();
Object ob = execute();
if (ob instanceof List) {
List ret = (List) ob;
@ -278,7 +278,7 @@ public class QueryImpl
* Execute a query that returns a single result.
*/
public Object getSingleResult() {
_em.assertOpen();
_em.assertNotCloseInvoked();
Object ob = execute();
if (!(ob instanceof List))
return ob;
@ -301,7 +301,7 @@ public class QueryImpl
}
public int executeUpdate() {
_em.assertOpen();
_em.assertNotCloseInvoked();
if (_query.getOperation() == OP_DELETE) {
// handle which types of parameters we are using, if any
if (_positional != null)
@ -339,14 +339,14 @@ public class QueryImpl
}
public OpenJPAQuery setFlushMode(FlushModeType flushMode) {
_em.assertOpen();
_em.assertNotCloseInvoked();
_query.getFetchConfiguration().setFlushBeforeQueries
(EntityManagerImpl.toFlushBeforeQueries(flushMode));
return this;
}
public OpenJPAQuery setHint(String key, Object value) {
_em.assertOpen();
_em.assertNotCloseInvoked();
if (key == null || !key.startsWith("openjpa."))
return this;
String k = key.substring("openjpa.".length());
@ -397,7 +397,8 @@ public class QueryImpl
}
public OpenJPAQuery setParameter(int position, Object value) {
_em.assertOpen();
_query.assertOpen();
_em.assertNotCloseInvoked();
_query.lock();
try {
// not allowed to mix positional and named parameters (EDR2 3.6.4)
@ -437,7 +438,8 @@ public class QueryImpl
}
public OpenJPAQuery setParameter(String name, Object value) {
_em.assertOpen();
_query.assertOpen();
_em.assertNotCloseInvoked();
_query.lock();
try {
// not allowed to mix positional and named parameters (EDR2 3.6.4)
@ -460,7 +462,6 @@ public class QueryImpl
}
public Object[] getPositionalParameters() {
_em.assertOpen();
_query.lock();
try {
return (_positional == null) ? EMPTY_ARRAY : _positional.toArray();
@ -470,7 +471,8 @@ public class QueryImpl
}
public OpenJPAQuery setParameters(Object... params) {
_em.assertOpen();
_query.assertOpen();
_em.assertNotCloseInvoked();
_query.lock();
try {
_positional = null;
@ -495,7 +497,8 @@ public class QueryImpl
}
public OpenJPAQuery setParameters(Map params) {
_em.assertOpen();
_query.assertOpen();
_em.assertNotCloseInvoked();
_query.lock();
try {
_positional = null;