mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Use executeBatch() for a batch update, not executeUpdate().
This commit is contained in:
@@ -591,8 +591,12 @@ abstract class JdbcDatabase implements Database<Connection> {
|
||||
ps.setBytes(2, id);
|
||||
ps.addBatch();
|
||||
}
|
||||
affected = ps.executeUpdate();
|
||||
if(affected != ids.size()) throw new DbStateException();
|
||||
int[] batchAffected = ps.executeBatch();
|
||||
if(batchAffected.length != ids.size())
|
||||
throw new DbStateException();
|
||||
for(int i = 0; i < batchAffected.length; i++) {
|
||||
if(batchAffected[i] != 1) throw new DbStateException();
|
||||
}
|
||||
ps.close();
|
||||
}
|
||||
// Create a connection time row
|
||||
|
||||
Reference in New Issue
Block a user