MCPcopy Create free account
hub / github.com/boxbeam/RedLib / setCommitInterval

Method setCommitInterval

src/redempt/redlib/sql/SQLHelper.java:444–454  ·  view source on GitHub ↗

Starts a task to call commit() on this SQLHelper every n ticks. Pass -1 to disable. Automatically sets autoCommit to false. @param ticks The number of ticks between commits, or -1 to disable

(int ticks)

Source from the content-addressed store, hash-verified

442 * @param ticks The number of ticks between commits, or -1 to disable
443 */
444 public void setCommitInterval(int ticks) {
445 if (commitTask != null) {
446 commitTask.cancel();
447 commitTask = null;
448 }
449 if (ticks == -1) {
450 return;
451 }
452 setAutoCommit(false);
453 commitTask = Task.syncRepeating(RedLib.getInstance(), this::commit, ticks, ticks);
454 }
455
456 /**
457 * Flushes all caches and commits the transaction

Callers 3

setAutoCommitMethod · 0.95
closeMethod · 0.95
SQLiteBackendMethod · 0.80

Calls 4

setAutoCommitMethod · 0.95
syncRepeatingMethod · 0.95
getInstanceMethod · 0.95
cancelMethod · 0.45

Tested by

no test coverage detected