summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2013-07-04 12:34:40 -0400
committerKeith Bostic <keith@wiredtiger.com>2013-07-04 12:34:40 -0400
commitd1602b24ea93d867a4f4f60c4eaa9d49787ddef6 (patch)
treeb488366dcb600f7f493d1533b6838989339fb4d8 /examples
parent392242e7f5c3c2f47eda7d8b6e6068b5b1dcc9bd (diff)
downloadmongo-d1602b24ea93d867a4f4f60c4eaa9d49787ddef6.tar.gz
More transactional code for the Memrata device.
Check if the update can proceed on inserts and updatest, fix the overwrite stuff (again). Probably still wrong, but I'll wait until I can run the test suite to fix it. Add support for setting the transaction state on commit/rollback; walk the session handle and for every data-source cursor, call an underlying commit or rollback function. I don't see another solution, so I'm doing this until Michael weighs in: I'm adding private WT_CURSOR methods the data-source code sets, which is flatly wrong, but the other approaches seem worse. Another WT_EXTENSION_API method: the transaction_snapshot_isolation method returns if snapshot isolation is configured for the current transaction. Change the WT_EXTENSION_API transaction_id method to return the transaction ID; it's no more likely to fail than the other transaction methods, and I don't see them failing in the future either. It's a little dangerous, but I'd rather keep error handling simple if we can.
Diffstat (limited to 'examples')
-rw-r--r--examples/c/ex_data_source.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/examples/c/ex_data_source.c b/examples/c/ex_data_source.c
index 662dcdc8b1d..35dfa9182af 100644
--- a/examples/c/ex_data_source.c
+++ b/examples/c/ex_data_source.c
@@ -155,11 +155,21 @@ static int my_cursor_insert(WT_CURSOR *wtcursor)
int ret;
{
+ int is_snapshot_isolation;
+ /*! [WT_EXTENSION transaction snapshot isolation] */
+ is_snapshot_isolation =
+ wt_api->transaction_snapshot_isolation(wt_api, session);
+ /*! [WT_EXTENSION transaction snapshot isolation] */
+ (void)is_snapshot_isolation;
+ }
+
+ {
/*! [WT_EXTENSION transaction ID] */
uint64_t transaction_id;
- ret = wt_api->transaction_id(wt_api, session, &transaction_id);
+ transaction_id = wt_api->transaction_id(wt_api, session);
/*! [WT_EXTENSION transaction ID] */
+ (void)transaction_id;
}
{