objectbox / objectbox-c

C and C++ database for objects and structs
https://objectbox.io/
Apache License 2.0
200 stars 35 forks source link

'Skipped low-level close of cursor' after re-creating transaction #2

Closed snakelizzard closed 4 years ago

snakelizzard commented 5 years ago

If I re-create transaction for same table right after previous is closed, I always get warning [WARN ] Skipped low-level close of cursor (write, TX #xxx alive). Imagine there is following code:

auto txn = obx_txn_begin(store);
auto cursor = obx_cursor_create(txn, 1);
obx_cursor_put(cursor, <something>);
obx_cursor_close(cursor);
obx_txn_close(txn);
txn = obx_txn_begin(store);
cursor = obx_cursor_create(txn, 1);

I will produce this warning unless there will be timeout before starting second transaction. I believe there should be convenience function to wait for transaction is completed for this case.

snakelizzard commented 5 years ago

This can be related to objectbox/objectbox-java#196

greenrobot commented 4 years ago

Should be fixed by now (see the related Java issue)?