JD: Only call after tryToExpand returning true
429051
public void split()
	{

		//this.statisticsOtherBranchSplit  = this.learningNode.getStatisticsOtherBranchSplit(); 
		//create a split node,
		int splitIndex = this.learningNode.getSplitIndex();
		InstanceConditionalTest st=this.learningNode.getBestSuggestion().splitTest;
		if(st instanceof NumericAttributeBinaryTest ) {
			NumericAttributeBinaryTest splitTest = (NumericAttributeBinaryTest) st;
			NumericAttributeBinaryRulePredicate predicate = new NumericAttributeBinaryRulePredicate(
					splitTest.getAttsTestDependsOn()[0], splitTest.getSplitValue(),
					splitIndex + 1);
			RuleSplitNode ruleSplitNode = new RuleSplitNode(predicate, this.learningNode.getStatisticsBranchSplit() );



			if (this.nodeListAdd(ruleSplitNode) == true) {
				// create a new learning node
				RuleActiveLearningNode newLearningNode = newRuleActiveLearningNode(this.getBuilder().statistics(this.learningNode.getStatisticsNewRuleActiveLearningNode())); 
				newLearningNode.initialize(this.learningNode);
				this.learningNode = newLearningNode;
			}
		}
		else
			throw new UnsupportedOperationException("AMRules (currently) only supports numerical attributes.");

	}
257085
private boolean decodeBulkStringEndOfLine(ByteBuf in, List<Object> out) throws Exception {
        if (in.readableBytes() < RedisConstants.EOL_LENGTH) {
            return false;
        }
        readEndOfLine(in);
        out.add(FullBulkStringRedisMessage.EMPTY_INSTANCE);
        resetDecoder();
        return true;
    }
109952
private void checkAndExecuteBeforeAfters(final Object obj, final Class<? extends Annotation> anno, final Method... meths) {
        final PerfidixMethodCheckException checkExc = checkMethod(obj, anno, meths);
        if (checkExc == null) {
            for (Method m : meths) {
                final PerfidixMethodInvocationException invoExc = invokeMethod(obj, anno, m);
                if (invoExc != null) {
                    BENCHRES.addException(invoExc);
                }
            }
        } else {
            BENCHRES.addException(checkExc);
        }
    }
511539
@Override
	public final int executeUpdate() throws SQLException {
		Split split = prepare();
		try {
			return stmt.executeUpdate();
		} finally {
			finish(split);
		}
	}
857401
private static Field tryGetFieldWithoutExp(Class<?> clazz, String itemName) {

        try {

            return clazz.getDeclaredField(itemName);

        } catch (Exception e) {
            return null;
        }
    }
1002869
@Override
    public boolean afterUpdate(Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock) throws CacheException {
        log.debug("region access strategy nonstrict-read-write entity afterUpdate() {} {}", getInternalRegion().getCacheNamespace(), key);
        getInternalRegion().evict(key);
        return false;
    }
1294482
@Override public boolean block() throws InterruptedException {
    while( !isDone() ) {
      try { get(); }
      catch(ExecutionException eex) { // skip the execution part
        Throwable tex = eex.getCause();
        if( tex instanceof                 Error) throw (                Error)tex;
        if( tex instanceof  DistributedException) throw ( DistributedException)tex;
        if( tex instanceof JobCancelledException) throw (JobCancelledException)tex;
        throw new RuntimeException(tex);
      }
      catch(CancellationException cex) { Log.errRTExcept(cex); }
    }
    return true;
  }
66334
private int getMatchedDepth(String exceptionType, Throwable ex) {
        Throwable t = ex.getCause();
        if (t != null) {
            return getMatchedDepth(exceptionType, t);
        } else {
            return getMatchedDepth(exceptionType, ex.getClass(), 0);
        }
    }
395577
private static void expandThrowable(Throwable ex)
    {
        ex.printStackTrace(__printWriter);

        if (ex instanceof MultiException)
        {
            MultiException mx = (MultiException)ex;
            
            for (int i=0;i<mx.size();i++)
            {
                __printWriter.print("["+i+"]=");
                Throwable ex2=mx.getException(i);
                expandThrowable(ex2);
            }
        }
        else
        {
            for (int i=0;i<__nestedEx.length;i++)
            {
                try
                {
                    Method getTargetException =
                        ex.getClass().getMethod(__nestedEx[i],__noArgs);
                    Throwable ex2=(Throwable)getTargetException.invoke(ex,(java.lang.Object[])null);
                    if (ex2!=null)
                    {
                        __printWriter.println(__nestedEx[i]+"():");
                        expandThrowable(ex2);
                    }
                }
                catch(Exception ignore){}
            }
        }
    }
472155
function tryAndDelay(fn) {
  var args = _.chain(arguments).rest().initial().value();
  var callback = _.last(arguments);
  try {
    process.nextTick(_.partial(callback, null, fn.apply(null, args)));
  } catch (err) {
    process.nextTick(_.partial(callback, err));
  }
}
374106
private void throwExIntParam(MethodVisitor mv, Class<?> exCls) {
		String exSig = Type.getInternalName(exCls);
		mv.visitTypeInsn(NEW, exSig);
		mv.visitInsn(DUP);
		mv.visitLdcInsn("mapping " + this.className + " failed to map field:");
		mv.visitVarInsn(ILOAD, 2);
		mv.visitMethodInsn(INVOKESTATIC, "java/lang/Integer", "toString", "(I)Ljava/lang/String;");
		mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "concat", "(Ljava/lang/String;)Ljava/lang/String;");
		mv.visitMethodInsn(INVOKESPECIAL, exSig, "<init>", "(Ljava/lang/String;)V");
		mv.visitInsn(ATHROW);
	}
299011
private void getSPARQLExpansionActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_getSPARQLExpansionActionPerformed
		Thread queryRunnerThread = new Thread(new Runnable() {
			@Override
			public void run() {
				OBDADataQueryAction<?> action = QueryInterfacePanel.this.getRetrieveUCQExpansionAction();
				action.run(queryTextPane.getText());
			}
		});
		queryRunnerThread.start();
	}
1065507
public boolean hasNext() {
    synchronized (lock) {
      try {
        return parser.peek() != JsonToken.END_DOCUMENT;
      } catch (MalformedJsonException e) {
        throw new JsonSyntaxException(e);
      } catch (IOException e) {
        throw new JsonIOException(e);
      }
    }
  }
956173
@Override
	public boolean reachedEnd() {
		try {
			if (resultSet.isLast()) {
				resultSet.close();
				statement.close();
				dbConn.close();
				return true;
			} else {
				return false;
			}
		} catch (SQLException e) {
			throw new IllegalArgumentException("Couldn't evaluate reachedEnd():\t" + e.getMessage());
		} catch (NullPointerException e) {
			throw new IllegalArgumentException("Couldn't access resultSet:\t" + e.getMessage());
		}
	}
1045217
function tryParseInline (s) {
    if (/INLINE/.test(s)) {
      // Use non greedy match so that INLINE and FUNCTION SOURCE items
      // on the same line don't interfere, else the INLINE function name
      // would contain everything up to the ) in FUNCTION SOURCE ()
      const [ match, inlinedFn ] = /INLINE \((.*?)\) id\{/.exec(s) || [ false ]
      // shouldn't not match though..
      if (match === false) return -1

      if (lastOptimizedFrame === null) return -1
      const { fn, file } = lastOptimizedFrame
      // could be a big problem if the fn doesn't match
      if (fn !== inlinedFn) return -1

      const key = `${fn} ${file}`
      inlined[key] = inlined[key] || []
      inlined[key].push(lastOptimizedFrame)
      return match.length
    }
    return 0
  }
1303807
boolean handlePropertyHits(BackedSession d2, Thread t, int len) {
        if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_WAS.entering(methodClassName, methodNames[HANDLE_PROPERTY_HITS]);
        }

        Enumeration vEnum = null;
        boolean doWrite = false;

        Connection conn = null;
        String id = d2.getId();
        String propid = null;
        PreparedStatement batchUpdatePS = null;
        PreparedStatement batchInsertPS = null;
        PreparedStatement batchDeletePS = null;
        LinkedList<DatabaseMRHelper> insertBatch = new LinkedList<DatabaseMRHelper>();

        boolean updateClose = false;
        boolean insertClose = false;
        boolean delClose = false;

        conn = getConnection(false);
        if (conn == null) {
            return true;
        }
        if (!multirowInitialized) {
            try {
                initMultirowDBTypes(conn);
            } catch (SQLException e) {
                if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled()&&LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                    LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "problem getting types", e); //PM99783
                }
                if (conn != null)
                    closeConnection(conn);
                return false;
            }
        }

        try {
            // we are not synchronized here - were not in old code either
            Hashtable sht = null;
            if (_smc.writeAllProperties()) {
                Hashtable ht = (Hashtable) d2.getSwappableData();
                vEnum = ht.keys();
                doWrite = true;
                if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                    LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "doing app changes for ALL mSwappable Data " + ht.toString());
                }
            } else {
                if (d2.appDataChanges != null) {
                    if (appDataTablesPerThread) {
                        if ((sht = (Hashtable) d2.appDataChanges.get(t)) != null) {
                            doWrite = true;
                            if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                                LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "doing app changes for " + id + " on thread "
                                                                                                                                    + t);
                            }
                            if (sht != null) {
                                vEnum = sht.keys();
                            } else {
                                vEnum = (new Hashtable()).keys();
                            }
                        }
                    } else { // appDataTablesPerSession
                        doWrite = true;
                        vEnum = d2.appDataChanges.keys();
                        if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "doing app changes for TimeBasedWrite");
                        }
                    }
                }

            }

            if (doWrite) {
                int enumCount = 0;
                batchUpdatePS = conn.prepareStatement(upAnyProp);
                while (vEnum.hasMoreElements()) {
                    enumCount++;
                    if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                        LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "enumCount is now " + enumCount);
                    }
                    long startTime = System.currentTimeMillis();
                    //*start *dbc2.2

                    if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                        LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "about to do vEnum.nextElement");
                    }

                    propid = (String) vEnum.nextElement();
                    if (id.equals(propid)) {
                        LoggingUtil.SESSION_LOGGER_WAS.logp(Level.WARNING, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "DatabaseHashMapMR.AttributeEqualsSessionIdWarning",
                                                            propid);
                        continue;
                    } else {
                        if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "it worked and the propid is: " + propid);
                        }
                    }

                    ByteArrayOutputStream baos = new ByteArrayOutputStream();

                    ObjectOutputStream oos = createObjectOutputStream(baos);
                    oos.writeObject(d2.getSwappableData().get(propid));
                    oos.flush();

                    int size = baos.size();
                    byte[] objbuf = baos.toByteArray();
                    if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                        LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "size for " + propid + " is " + size);
                    }

                    oos.close();
                    baos.close();

                    int rowsRet = 0;

                    if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                        LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "before update " + propid + " for session " + id);
                    }

                    // based on the amount of data, we choose whether to go to the
                    // small, medium, or large columns (nulling out whatever is
                    // in the other columns).  We first attempt an update.  If a
                    // row count > 0 is returned, we are done.  Otherwise, the
                    // row does not yet exist so we insert.

                    if (size <= smallColSize) {
                        if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "storing in small which can handle up to "
                                                                                                                                + smallColSize + " bytes");
                        }

                        if (!usingInformix) {
                            batchUpdatePS.setBytes(1, objbuf);
                            batchUpdatePS.setNull(2, mediumPropType);
                            batchUpdatePS.setNull(3, largePropType);
                        } else {
                            ByteArrayInputStream bis = new ByteArrayInputStream(objbuf);
                            batchUpdatePS.setBinaryStream(1, bis, objbuf.length);
                            batchUpdatePS.setNull(2, mediumPropType);
                            batchUpdatePS.setNull(3, largePropType);
                        }
                        batchUpdatePS.setString(4, id);
                        batchUpdatePS.setString(5, propid);
                        batchUpdatePS.setString(6, getAppName());
                        batchUpdatePS.addBatch();
                        //in case we need to do an insert on this afterwards
                        //<string, string, byte[]>
                        DatabaseMRHelper helper = new DatabaseMRHelper();
                        helper.setId(id);
                        helper.setPropId(propid);
                        helper.setObject(objbuf);
                        if (usingInformix) {
                            helper.setUseStream(true);
                        }
                        helper.setAppName(getAppName());
                        helper.setSize(DatabaseMRHelper.SMALL);
                        insertBatch.add(helper);

                        // note, the old value in the medium column is left alone
                        // since further access when look at the small column first
                    } else if (size <= mediumColSize) {
                        if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "storing in medium which can handle up to "
                                                                                                                                + mediumColSize + " bytes");
                        }

                        if ((!usingInformix) && (!_smc.isUseOracleBlob())) {
                            batchUpdatePS.setNull(1, smallPropType);
                            batchUpdatePS.setBytes(2, objbuf);
                            batchUpdatePS.setNull(3, largePropType);
                        } else {
                            ByteArrayInputStream bis = new ByteArrayInputStream(objbuf);
                            batchUpdatePS.setNull(1, smallPropType);
                            batchUpdatePS.setBinaryStream(2, bis, objbuf.length);
                            batchUpdatePS.setNull(3, largePropType);
                        }
                        batchUpdatePS.setString(4, id);
                        batchUpdatePS.setString(5, propid);
                        batchUpdatePS.setString(6, getAppName());

                        batchUpdatePS.addBatch();
                        DatabaseMRHelper helper = new DatabaseMRHelper();
                        helper.setId(id);
                        helper.setPropId(propid);
                        helper.setObject(objbuf);
                        if (usingInformix || _smc.isUseOracleBlob()) {
                            helper.setUseStream(true);
                        }
                        helper.setAppName(getAppName());
                        helper.setSize(DatabaseMRHelper.MEDIUM);
                        insertBatch.add(helper);
                    } else if (size <= largeColSize) {
                        if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "storing in large which can handle up to "
                                                                                                                                + largeColSize + " bytes");
                        }
                        // note, the old value in the largecolumn is left alone
                        // since further access will look at the small column and then the
                        // medium column prior to the large column

                        if (!usingInformix) {
                            batchUpdatePS.setNull(1, smallPropType);
                            batchUpdatePS.setNull(2, mediumPropType);
                            batchUpdatePS.setBytes(3, objbuf);
                        } else {
                            ByteArrayInputStream bis = new ByteArrayInputStream(objbuf);
                            batchUpdatePS.setNull(1, smallPropType);
                            batchUpdatePS.setNull(2, mediumPropType);
                            batchUpdatePS.setBinaryStream(3, bis, objbuf.length);
                        }
                        batchUpdatePS.setString(4, id);
                        batchUpdatePS.setString(5, propid);
                        batchUpdatePS.setString(6, getAppName());

                        batchUpdatePS.addBatch();

                        DatabaseMRHelper helper = new DatabaseMRHelper();
                        helper.setId(id);
                        helper.setPropId(propid);
                        helper.setObject(objbuf);
                        if (usingInformix) {
                            //ByteArrayInputStream bis = new ByteArrayInputStream(objbuf);
                            //inssps.setBinaryStream(3, bis, objbuf.length);
                            helper.setUseStream(true);
                        }
                        helper.setAppName(getAppName());
                        helper.setSize(DatabaseMRHelper.LARGE);
                        insertBatch.add(helper);
                    } else { // too big 325643
                        LoggingUtil.SESSION_LOGGER_WAS.logp(Level.SEVERE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "DatabaseHashMapMR.db2LongVarCharErr");
                        LoggingUtil.SESSION_LOGGER_WAS.logp(Level.SEVERE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "DatabaseHashMapMR.propertyTooBig", propid);
                    }

                    if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                        LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "after commit " + propid + " for session " + id);
                    }
                    SessionStatistics pmiStats = _iStore.getSessionStatistics();
                    if (pmiStats != null) {
                        pmiStats.writeTimes(objbuf.length, System.currentTimeMillis() - startTime);
                    }

                }
                int updateCount = 0; //PM99783
                int[] results = null;
                if (enumCount>0) {
                    results = batchUpdatePS.executeBatch();
                    if (usingOracle) { //PM99783 when on Oracle DB, executeBatch() returns -2 (SUCCESS_NO_INFO), might be related to BatchPerformanceWorkaround Oracle property, hence we getUpdateCount instead
                        updateCount = batchUpdatePS.getUpdateCount();
                    }
                } else {
                    results = new int[0]; //skip trying to insert
                }
                batchUpdatePS.close();
                updateClose=true;
                if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                    LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "after " + results.length + " batch update(s), total update count : " + updateCount);
                }
                boolean needToInsert = false;
                int batchInsertPSCount = results.length;
                // PI53220 Oracle 11 returns -2 (SUCCESS_NO_INFO); PI57327 Oracle 12 returns successful results.
                if (results[0] == java.sql.Statement.SUCCESS_NO_INFO && updateCount > 0 && (_smc.writeAllProperties() || batchInsertPSCount == updateCount))
                {
                    batchInsertPSCount = batchInsertPSCount - updateCount; // Oracle only : when Write All option or no insert cases
                }
                for (int i=0;i<batchInsertPSCount;i++) {
                    if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                        LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "For batch # " + (i+1) + ", update result : " + results[i]);
                    }
                    if (results[i]<=0) { //no rows updated (PM99783)
                        if (!needToInsert) {
                            needToInsert = true;
                            batchInsertPS = conn.prepareStatement(insAnyProp);
                        }
                        DatabaseMRHelper updateRow = insertBatch.get(i);
                        batchInsertPS.setString(1, updateRow.getId());
                        batchInsertPS.setString(2, updateRow.getPropId());
                        if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "Insert attribute " + updateRow.getPropId());
                        }
                        switch (updateRow.getSize()) {
                        case DatabaseMRHelper.SMALL:
                            if (!updateRow.isUseStream()) {
                                batchInsertPS.setBytes(3, updateRow.getObject());
                                batchInsertPS.setNull(4, mediumPropType);
                                batchInsertPS.setNull(5, largePropType);
                            } else {
                                byte[] objbuf = updateRow.getObject();
                                ByteArrayInputStream bis = new ByteArrayInputStream(objbuf);
                                batchInsertPS.setBinaryStream(3, bis, objbuf.length);
                                batchInsertPS.setNull(4, mediumPropType);
                                batchInsertPS.setNull(5, largePropType);
                            }
                            break;
                        case DatabaseMRHelper.MEDIUM:
                            if (!updateRow.isUseStream()) {
                                batchInsertPS.setNull(3, smallPropType);
                                batchInsertPS.setBytes(4, updateRow.getObject());
                                batchInsertPS.setNull(5, largePropType);
                            } else {
                                byte[] objbuf = updateRow.getObject();
                                ByteArrayInputStream bis = new ByteArrayInputStream(objbuf);
                                batchInsertPS.setNull(3, smallPropType);
                                batchInsertPS.setBinaryStream(4, bis, objbuf.length);
                                batchInsertPS.setNull(5, largePropType);
                            }
                            break;
                        case DatabaseMRHelper.LARGE:
                            if (!updateRow.isUseStream()) {
                                batchInsertPS.setNull(3, smallPropType);
                                batchInsertPS.setNull(4, mediumPropType);
                                batchInsertPS.setBytes(5, updateRow.getObject());
                            } else {
                                byte[] objbuf = updateRow.getObject();
                                ByteArrayInputStream bis = new ByteArrayInputStream(objbuf);
                                batchInsertPS.setNull(3, smallPropType);
                                batchInsertPS.setNull(4, mediumPropType);
                                batchInsertPS.setBinaryStream(5, bis, objbuf.length);
                            }
                            break;
                        default:
                            break;
                        }

                        batchInsertPS.setString(6, updateRow.getAppName());
                        batchInsertPS.addBatch();
                    }
                }
                //try inserts
                results = new int[0];
                if (needToInsert) {
                    try {
                        results = batchInsertPS.executeBatch();
                    } catch (java.sql.BatchUpdateException e) {
                        if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "Continue insert due to BatchPerformanceWorkaround enabled");
                        }
                    }
                    batchInsertPS.close();
                    insertClose=true;
                }
                if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled()&&LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                    int problemCntr = 0;
                    for (int i:results) {
                        if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "Insert result : " + i);
                        }
                        if (usingOracle && i == java.sql.Statement.SUCCESS_NO_INFO) { //PM99783
                            //Oracle executeBatch() returns -2 (SUCCESS_NO_INFO)
                        }
                        else if (i < 0) {
                            problemCntr++;
                        }
                    }
                    if (problemCntr>0) {
                        LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "Problem updating/creating "+ problemCntr + " attributes");
                    }
                }
                if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                    LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "Exitting Loop ... all properties writes are done");
                }
                if (appDataTablesPerThread) {
                    if (d2.appDataChanges != null)
                        d2.appDataChanges.remove(t);
                    if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                        LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "remove thread from appDataChanges for thread: " + t);
                    }
                } else { //appDataTablesPerSession
                    if (d2.appDataChanges != null)
                        d2.appDataChanges.clear();
                    if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                        LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "clearing appDataChanges");
                    }
                }
            }

            // see if any properties were REMOVED.
            // if so, process them

            Enumeration vEnum2 = null;

            if (d2.appDataRemovals != null) {
                if (!appDataTablesPerThread) { // appDataTablesPerSession
                    vEnum2 = d2.appDataRemovals.keys();
                    if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                        LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "doing app removals for " + id + " on ALL threads");
                    }
                } else { //appDataTablesPerThread
                    if ((sht = (Hashtable) d2.appDataRemovals.get(t)) != null) {
                        if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "doing app removals for " + id + " on thread " + t);
                        }
                        if (sht != null) {
                            vEnum2 = sht.keys();
                        } else {
                            vEnum2 = (new Hashtable()).keys();
                        }
                    }
                }

                if (vEnum2 != null && vEnum2.hasMoreElements()) {
                    batchDeletePS = conn.prepareStatement(delProp);
                    while (vEnum2.hasMoreElements()) {
                        propid = (String) vEnum2.nextElement();
                        if (id.equals(propid)) {
                            //since the attribute was never stored on the database, this will do nothing.
                            //We don't even need a warning because they're removing it.
                            continue;
                        } else {
                            if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                                LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "deleting prop " + propid + " for session "
                                                                                                                                    + id);
                            }
                        }
                        batchDeletePS.setString(1, id);
                        batchDeletePS.setString(2, propid);
                        batchDeletePS.setString(3, getAppName()); //*dbc2.2
                        batchDeletePS.addBatch();

                        if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "after remove, before commit " + propid
                                                                                                                                + " for session " + id);
                            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "after commit " + propid + " for session " + id);
                        }
                    }
                    int results[] = batchDeletePS.executeBatch();
                    batchDeletePS.close();
                    delClose = true;
                    if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled()&&LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                        int problemCntr = 0;
                        for (int i:results) {
                            if (i<=0) {
                                problemCntr++;
                            }
                        }
                        if (problemCntr>0) {
                            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "There was a problem deleting " + problemCntr + " rows");
                        }
                    }
                }

                if (!appDataTablesPerThread) { // appDataTablesPerSession
                    if (d2.appDataRemovals != null)
                        d2.appDataRemovals.clear();
                    if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                        LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "clearing appDataRemovals");
                    }
                } else { //appDataTablesPerThread
                    if (d2.appDataRemovals != null)
                        d2.appDataRemovals.remove(t);
                    if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
                        LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "remove thread from appDataRemovals: " + t);
                    }
                }
            }
        } catch (SQLException se) {
            //            if (isStaleConnectionException(se)) {
            //                com.ibm.ws.ffdc.FFDCFilter.processException(se, "com.ibm.ws.session.store.db.DatabaseHashMapMR.handlePropertyHits", "422", d2);
            //                LoggingUtil.SESSION_LOGGER_WAS.logp(Level.SEVERE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "StaleConnectionException");
            //            } else {
            com.ibm.ws.ffdc.FFDCFilter.processException(se, "com.ibm.ws.session.store.db.DatabaseHashMapMR.handlePropertyHits", "428", d2);
            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.SEVERE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "DatabaseHashMapMR.propHitErr");
            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.SEVERE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "CommonMessage.exception", se);
            //            }
        } catch (Exception ee) {
            com.ibm.ws.ffdc.FFDCFilter.processException(ee, "com.ibm.ws.session.store.db.DatabaseHashMapMR.handlePropertyHits", "444", d2);
            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.SEVERE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "DatabaseHashMapMR.propHitErr");
            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.SEVERE, methodClassName, methodNames[HANDLE_PROPERTY_HITS], "CommonMessage.exception", ee);
        } finally {
            if (!updateClose && batchUpdatePS!=null) {
                closeStatement(batchUpdatePS);
            }
            if (!insertClose && batchInsertPS!=null) {
                closeStatement(batchInsertPS);
            }
            if (!delClose && batchDeletePS != null) {
                closeStatement(batchDeletePS);
            }
            if (conn != null) {
                closeConnection(conn);
            }
        }
        if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_WAS.exiting(methodClassName, methodNames[HANDLE_PROPERTY_HITS], Boolean.valueOf(true));
        }
        return true; // 325643
    }
1333338
@Override
    protected int onExecuteUpdate()
    {
        Map<String, Object> persistDetails = new HashMap<String, Object>();
        DataFrame dataFrame;
        try
        {
            String query = getJPAQuery();// .toLowerCase();

            persistDetails = parseInsertIntoQuery(query);

            dataFrame = getDataFrameToPersist(query, (String) persistDetails.get("fetchQuery"));

            String clientName = (String) persistDetails.get("client");

            SparkDataClient dataClient = SparkDataClientFactory.getDataClient(clientName);
            dataClient.saveDataFrame(dataFrame, getEntityMetadata().getEntityClazz(), persistDetails);
        }
        catch (Exception e)
        {
            logger.error("Error during executing query, Caused by:", e);
            throw new QueryHandlerException(e);
        }

        return getDataFrameSize(dataFrame);
    }