@Override protected Object executeCall(DatasourceCall databaseCall) throws DatabaseException { AbstractSession sessionToUse = this.query.getExecutionSession(); boolean doNotUseCachedInserts = Boolean.valueOf(String.valueOf(sessionToUse.getProperty("cuba.doNotUseCachedInserts"))); String cachedQuery = databaseCall.getQueryString(); if (doNotUseCachedInserts && cachedQuery != null && cachedQuery.startsWith("INSERT")) { Matcher matcher = INSERT_PATTERN.matcher(cachedQuery); if (matcher.find()) { String tableName = matcher.group(1); DatabaseTable targetTable = getDescriptor().getTable(tableName); SQLInsertStatement sqlInsertStatement = this.buildInsertStatement(targetTable); DatasourceCall call = getDescriptor().buildCallFromStatement(sqlInsertStatement, getQuery(), getExecutionSession()); call.setQuery(this.query); call.prepare(sessionToUse); call.translate(this.query.getTranslationRow(), getModifyRow(), sessionToUse); return sessionToUse.executeCall(call, this.query.getTranslationRow(), this.query); } } return super.executeCall(databaseCall); } // cuba end
/** * Execute the call. It is assumed the call has been fully prepared. * @exception DatabaseException - an error has occurred on the database. */ protected Object executeCall(DatasourceCall databaseCall) throws DatabaseException { // For CR 2923 must move to session we will execute call on now // so correct DatasourcePlatform used by translate. AbstractSession sessionToUse = this.query.getExecutionSession(); DatasourceCall clonedCall = (DatasourceCall)databaseCall.clone(); clonedCall.setQuery(this.query); clonedCall.translate(this.query.getTranslationRow(), getModifyRow(), sessionToUse); return sessionToUse.executeCall(clonedCall, this.query.getTranslationRow(), this.query); }
/** * Execute the call. It is assumed the call has been fully prepared. * @exception DatabaseException - an error has occurred on the database. */ protected Object executeCall(DatasourceCall databaseCall) throws DatabaseException { // For CR 2923 must move to session we will execute call on now // so correct DatasourcePlatform used by translate. AbstractSession sessionToUse = this.query.getExecutionSession(); DatasourceCall clonedCall = (DatasourceCall)databaseCall.clone(); clonedCall.setQuery(this.query); clonedCall.translate(this.query.getTranslationRow(), getModifyRow(), sessionToUse); return sessionToUse.executeCall(clonedCall, this.query.getTranslationRow(), this.query); }
/** * Execute the call. It is assumed the call has been fully prepared. * @exception DatabaseException - an error has occurred on the database. */ protected Object executeCall(DatasourceCall databaseCall) throws DatabaseException { // For CR 2923 must move to session we will execute call on now // so correct DatasourcePlatform used by translate. AbstractSession sessionToUse = this.query.getExecutionSession(); DatasourceCall clonedCall = (DatasourceCall)databaseCall.clone(); clonedCall.setQuery(this.query); clonedCall.translate(this.query.getTranslationRow(), getModifyRow(), sessionToUse); return sessionToUse.executeCall(clonedCall, this.query.getTranslationRow(), this.query); }