mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-22 15:49:53 +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.setBytes(2, id);
|
||||||
ps.addBatch();
|
ps.addBatch();
|
||||||
}
|
}
|
||||||
affected = ps.executeUpdate();
|
int[] batchAffected = ps.executeBatch();
|
||||||
if(affected != ids.size()) throw new DbStateException();
|
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();
|
ps.close();
|
||||||
}
|
}
|
||||||
// Create a connection time row
|
// Create a connection time row
|
||||||
|
|||||||
Reference in New Issue
Block a user