public interface Batcher
extends java.lang.AutoCloseable
Modifier and Type | Method and Description |
---|---|
void |
close()
Flush the batcher and close it.
|
void |
flush()
Flush the batcher and send all remaining items in memory to the
database.
|
int |
getBatchSize()
Get the current batch size of the batcher.
|
boolean |
isClosed()
Check if the batcher has been closed or not.
|
void |
setBatchSize(int batchSize)
Sets the batch size.
|
int getBatchSize()
void setBatchSize(int batchSize)
batchSize
- Size of the batch, or 0 to disable automatic flushingboolean isClosed()
DbControl
to connect to the database
will automatically be closed when the DbControl
is closed.close()
void flush() throws BaseException
BaseException
- If there is an errorclose()
void close() throws BaseException
DbControl
to connect to the database
will automatically be closed when the DbControl
is closed.close
in interface java.lang.AutoCloseable
BaseException
- If there is an errorisClosed()
,
flush()