diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W14.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W14.java index d7b9fbf..0411062 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W14.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W14.java @@ -59,8 +59,11 @@ public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int String to_address = WEB3Util .convertToAddressString(WEB3Util.randomNumber(1, WEB3Config.configAccountsCount, gen)); double value = (double) WEB3Util.randomNumber(0, 1000000, gen); - String transaction_hash = WEB3Util.convertToTxnHashString( - WEB3Util.randomNumber(1, numScale * WEB3Config.configTransactionsCount, gen)); + int transaction_hash_number = WEB3Util.randomNumber(1, numScale * WEB3Config.configTransactionsCount, + gen); + // make sure the startNumber is even, to avoid foreign key conflicts with W6 + transaction_hash_number = transaction_hash_number - (transaction_hash_number % 2); + String transaction_hash = WEB3Util.convertToTxnHashString(transaction_hash_number); long block_number = WEB3Util.randomNumber(1, numScale * WEB3Config.configBlocksCount, gen); long next_block_number = block_number + 1; diff --git a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W6.java b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W6.java index 9324e20..6c1361e 100755 --- a/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W6.java +++ b/src/com/olxpbenchmark/benchmarks/web3benchmark/procedures/W6.java @@ -51,8 +51,11 @@ public long run(Connection conn, Random gen, WEB3Worker w, int startNumber, int // initializing all prepared statements query_stmt = this.getPreparedStatement(conn, query_stmtSQL); + // make sure the startNumber is odd, to avoid foreign key conflicts with W14 + startNumber = startNumber - (startNumber % 2) + 1; String hash = WEB3Util.convertToTxnHashString(startNumber % (WEB3Config.configTransactionsCount * numScale)); + // Setting the parameters for the query query_stmt.setString(1, hash); if (LOG.isDebugEnabled()) { LOG.debug(queryToString(query_stmt));