#993 - ENH: Add flush() to EbeanServer and Model to make it more accessible than the current transaction.flushBatch()

This commit is contained in:
Rob Bygrave
2017-03-13 23:07:17 +13:00
parent 1d99a5c5a4
commit 4d82b86f81
8 changed files with 81 additions and 2 deletions
@@ -840,6 +840,11 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
return transactionScopeManager.get();
}
@Override
public void flush() {
currentTransaction().flush();
}
/**
* Commit the current transaction.
*/
@@ -731,13 +731,18 @@ public class JdbcTransaction implements SpiTransaction {
* </p>
*/
@Override
public void flushBatch() {
public void flush() {
if (!isActive()) {
throw new IllegalStateException(illegalStateMessage);
}
internalBatchFlush();
}
@Override
public void flushBatch() {
flush();
}
/**
* Flush the JDBC batch and execute derived relationship statements if necessary.
*/