File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed
frameworks/Kotlin/hexagon/store_sql/src/main/kotlin Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -63,26 +63,22 @@ class BenchmarkSqlStore(
6363
6464 override fun replaceWorlds (worlds : List <World >) {
6565 dataSource.connection.use { con: Connection ->
66- con.autoCommit = false
6766 val stmtSelect = con.prepareStatement(SELECT_WORLD )
68- val stmtUpdate = con.prepareStatement(UPDATE_WORLD )
69-
7067 worlds.forEach {
71- val worldId = it.id
72- val newRandomNumber = it.randomNumber
73-
74- stmtSelect.setInt(1 , worldId)
68+ stmtSelect.setInt(1 , it.id)
7569 val rs = stmtSelect.executeQuery()
7670 rs.next()
7771 rs.getInt(2 ) // Read 'randomNumber' to comply with Test type 5, point 6
72+ }
7873
79- stmtUpdate.setInt(1 , newRandomNumber)
80- stmtUpdate.setInt(2 , worldId)
81- // stmtUpdate.executeUpdate()
82- stmtUpdate.addBatch()
74+ val stmtUpdate = con.prepareStatement(UPDATE_WORLD )
75+ worlds.forEach {
76+ stmtUpdate.setInt(1 , it.randomNumber)
77+ stmtUpdate.setInt(2 , it.id)
78+ stmtUpdate.executeUpdate()
79+ // stmtUpdate.addBatch()
8380 }
84- stmtUpdate.executeBatch()
85- con.commit()
81+ // stmtUpdate.executeBatch()
8682 }
8783 }
8884
You can’t perform that action at this time.
0 commit comments