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(
63
63
64
64
override fun replaceWorlds (worlds : List <World >) {
65
65
dataSource.connection.use { con: Connection ->
66
- con.autoCommit = false
67
66
val stmtSelect = con.prepareStatement(SELECT_WORLD )
68
- val stmtUpdate = con.prepareStatement(UPDATE_WORLD )
69
-
70
67
worlds.forEach {
71
- val worldId = it.id
72
- val newRandomNumber = it.randomNumber
73
-
74
- stmtSelect.setInt(1 , worldId)
68
+ stmtSelect.setInt(1 , it.id)
75
69
val rs = stmtSelect.executeQuery()
76
70
rs.next()
77
71
rs.getInt(2 ) // Read 'randomNumber' to comply with Test type 5, point 6
72
+ }
78
73
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()
83
80
}
84
- stmtUpdate.executeBatch()
85
- con.commit()
81
+ // stmtUpdate.executeBatch()
86
82
}
87
83
}
88
84
You can’t perform that action at this time.
0 commit comments