I am using the JetBrains Exposed library available here on Github.
The documentation mentions that all database queries should be performed in a transaction{ }
block. The changes to database are then commited at the end of the transaction.
Is it possible to force commit changes before the end of transaction block? See pseudo code below.
Transaction {
/*someDatabaseOperation()*/
forceCommit()
/*moreDatabaseOperations()*/
}
I can use the connection.autoCommit
feature within a transaction block.
transaction {
connection.autoCommit /*below operations will be comitted sequentially*/
someDatabaseOperation()
moreDatabaseOperations()
}
see related discussion here.