Opened 13 years ago
Closed 13 years ago
#3745 closed enhancement (fixed)
Add transaction support to the CPL ODBC layer
Reported by: | tamas | Owned by: | tamas |
---|---|---|---|
Priority: | normal | Milestone: | 1.8.0 |
Component: | default | Version: | unspecified |
Severity: | normal | Keywords: | odbc |
Cc: |
Description
This patch would include transaction support to the current ODBC implementation in GDAL. Transactions in ODBC are managed at the connection level. When an application completes a transaction, it commits or rolls back all work completed through all statement handles on that connection. To commit or roll back a transaction, applications should call SQLEndTran instead of submitting a COMMIT or ROLLBACK statement directly in order to let ODBC the driver manage the transaction state correctly. An application calls SQLSetConnectAttr to switch between the two ODBC modes of managing transactions: the Autocommit mode (the default) and Manual Commit mode.
The suggested implementation would provide the following approach in order to keep this option as simple as possible:
- The connection operates in autocommit mode by default, which preserves the compatibility with the existing applications
- Application (ie. an OGR driver) should call CPLODBCSession:BeginTransaction to begin a transaction scope. This function switch the transaction to manual commit mode.
- Application should call CPLODBCSession:CommitTransaction to commit the changes made since the BeginTransaction has been called.
- CPLODBCSession:RollbackTransaction is implemented, but it may not necessarily be called since it is called automatically if there was a failure within a transaction.
- The connection is switched back to autocommit mode if a sql operation is called outside of the scope of a transaction.
Attachments (1)
Change History (4)
by , 13 years ago
Attachment: | cpl_odbc.patch added |
---|
comment:1 by , 13 years ago
Keywords: | odbc added |
---|
comment:3 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Tamas,
It looks good to me. I think you should go ahead and commit it.