public abstract class AbstractPdbBatch extends Object implements PdbBatch
PdbBatch with useful default base methods for concrete implementations.| Constructor and Description |
|---|
AbstractPdbBatch() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(String entityName,
EntityEntry ee)
Adds the entry to the batch.
|
CompletableFuture<Void> |
flushAsync()
Flushes the pending batches asynchronously, if the implementation allows it; otherwise, by default, this should
simply call
PdbBatch.flush() and return the future when done. |
protected void |
processBatch(DatabaseEngine de,
List<BatchEntry> batchEntries)
Processes all batch entries.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclosepublic void add(String entityName, EntityEntry ee) throws Exception
PdbBatchpublic CompletableFuture<Void> flushAsync()
PdbBatchPdbBatch.flush() and return the future when done.flushAsync in interface PdbBatchCompletableFuture that completes when the flush action finishes.protected void processBatch(DatabaseEngine de, List<BatchEntry> batchEntries) throws DatabaseEngineException
This is done by starting a transaction, adding all batch entries to their respective prepared
statements, flushing them and finally performing a commit on the transaction (which will finish that transaction).
de - The DatabaseEngine on which to perform the flush.batchEntries - The list of batch entries to be flushed.DatabaseEngineException - If the operation failed.Copyright © 2023 Feedzai. All rights reserved.