Merge lp:~mmcm/akiban-server/pg-periodically-commit into lp:~akiban-technologies/akiban-server/trunk
Status: | Merged |
---|---|
Approved by: | Nathan Williams |
Approved revision: | 2738 |
Merged at revision: | 2737 |
Proposed branch: | lp:~mmcm/akiban-server/pg-periodically-commit |
Merge into: | lp:~akiban-technologies/akiban-server/trunk |
Prerequisite: | lp:~mmcm/akiban-server/pg-server-set-variable |
Diff against target: |
214 lines (+51/-11) 7 files modified
src/main/java/com/akiban/server/service/transaction/TransactionService.java (+3/-0) src/main/java/com/akiban/server/store/PersistitTransactionService.java (+5/-0) src/main/java/com/akiban/sql/embedded/JDBCConnection.java (+2/-2) src/main/java/com/akiban/sql/pg/PostgresSessionStatement.java (+1/-1) src/main/java/com/akiban/sql/server/ServerSession.java (+3/-0) src/main/java/com/akiban/sql/server/ServerSessionBase.java (+19/-6) src/main/java/com/akiban/sql/server/ServerTransaction.java (+18/-2) |
To merge this branch: | bzr merge lp:~mmcm/akiban-server/pg-periodically-commit |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Nathan Williams | Approve | ||
Review via email: mp+179829@code.launchpad.net |
Description of the change
Add a mode where explicit transaction commits from time to time.
This is useful for initial data loads from a program that believes that it is doing all the loading with auto-commit off but failing due to the 5 second FDB limitation.
It is controlled by a connection property. It might be cleaner to have it be an extension to SET SESSION CHARACTERISTICS AS TRANSACTION. However, a property has the advantage that is can be set by another process, thereby avoiding the need to alter the application.
The check is done at the end of each statement, where auto-commit would be done. This means that it really only works for a series of isolated statements, like a bunch of INSERTs. It does not work, in particular, for a large DELETE or UPDATE. These are problematic because there is a scan, too, so the underlying transaction cannot be commited invisibly. I am open to suggestions for how to extend / replace this to handle those cases.
The implementation for the default store (Persistit) in this branch is empty. An FDB branch will actually do something.
Looks good.