Object result = null; if (!shouldMaintainCache() || isReadOnly()) { result = unitOfWork.getParent().executeQuery(this, translationRow); } else {
protected void preExecute(JpaQuery jpaQuery) { // copying behaviour of org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery() DatabaseQuery elDbQuery = ((EJBQueryImpl) jpaQuery).getDatabaseQueryInternal(); boolean isObjectLevelReadQuery = elDbQuery.isObjectLevelReadQuery(); if (jpaQuery.getFlushMode() == FlushModeType.AUTO && (!isObjectLevelReadQuery || !((ObjectLevelReadQuery) elDbQuery).isReadOnly())) { // flush is expected support.fireEntityListeners(entityManager, true); } }
protected Session getActiveSession() { DatabaseQuery query = getDatabaseQueryInternal(); // PERF: If read-only query, avoid creating unit of work and JTA transaction. if (query.isObjectLevelReadQuery() && ((ObjectLevelReadQuery) query).isReadOnly()) { return this.entityManager.getReadOnlySession(); } return this.entityManager.getActiveSession(); }
Object result = null; if (!shouldMaintainCache() || isReadOnly()) { result = unitOfWork.getParent().executeQuery(this, translationRow); } else {
Object result = null; if (!shouldMaintainCache() || isReadOnly()) { result = unitOfWork.getParent().executeQuery(this, translationRow); } else {
/** * INTERNAL: * Release (if required) connection after call. * @param query */ public void releaseConnectionAfterCall(DatabaseQuery query) { if ((!isInTransaction() || (query.isObjectLevelReadQuery() && ((ObjectLevelReadQuery)query).isReadOnly())) && !isExclusiveIsolatedClientSession() ) { this.parent.releaseConnectionAfterCall(query); } else { if (hasWriteConnection()) { query.setAccessors(null); this.parent.releaseClientSession(this); } } }
/** * INTERNAL: * Release (if required) connection after call. * @param query */ public void releaseConnectionAfterCall(DatabaseQuery query) { if ((!isInTransaction() || (query.isObjectLevelReadQuery() && ((ObjectLevelReadQuery)query).isReadOnly())) && !isExclusiveIsolatedClientSession() ) { this.parent.releaseConnectionAfterCall(query); } else { if (hasWriteConnection()) { query.setAccessors(null); this.parent.releaseClientSession(this); } } }
if ((!isInTransaction() || (query.isObjectLevelReadQuery() && ((ObjectLevelReadQuery)query).isReadOnly())) && !isExclusiveIsolatedClientSession() ) { return this.parent.executeCall(call, translationRow, query);
if ((!isInTransaction() || (query.isObjectLevelReadQuery() && ((ObjectLevelReadQuery)query).isReadOnly())) && !isExclusiveIsolatedClientSession() ) { return this.parent.executeCall(call, translationRow, query);
if (readQuery.isReadOnly()) { method.addLine(queryIdentifier + ".setIsReadOnly(true);");
if (readQuery.isReadOnly()) { method.addLine(queryIdentifier + ".setIsReadOnly(true);");
if (readQuery.isReadOnly()) { method.addLine(queryIdentifier + ".setIsReadOnly(true);");
DatabaseQuery query = getDatabaseQueryInternal(); boolean isObjectLevelReadQuery = query.isObjectLevelReadQuery(); if (isFlushModeAUTO() && (!isObjectLevelReadQuery || !((ObjectLevelReadQuery)query).isReadOnly())) { performPreQueryFlush(); if (isObjectLevelReadQuery) {