You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When processing through records to delete oldest, the following error is thrown: Current transaction contains open cursors. Close cursors before run Commit()
Code to Reproduce
using (var db = new LiteDatabase(connSharedReadWrite))
{
// .... set min/max records and step
long min=0, max=10000000;
int step = 10000;
long recordsToDelete = 250000;
long recordsDeleted = 0;
// Process
while (min < max)
{
//Process each step..
foreach (DbObject item in col.Find(Query.All("ObjectDateTime", Query.Ascending)).Skip(0).Take(step).ToArray())
{
//Delete Record
col.Delete(BsonMapper.Global.Serialize(item)["_id"]);
recordsDeleted+=1;
if (recordsDeleted >= recordsToDelete)
break;
}
if (recordsDeleted >= recordsToDelete)
break;
//Update position
min += step;
}
}
Expected behavior
In v5.018 and lower, this functions as expected and deletes records.
The text was updated successfully, but these errors were encountered:
dethknite
changed the title
Current transaction contains open cursors. Close cursors before run Commit() in 5.0.19
[BUG] Current transaction contains open cursors. Close cursors before run Commit() in 5.0.19
Mar 25, 2024
This issue has been resolved in the latest version of LiteDB.
Please update to the latest version of LiteDB to resolve this issue.
If the issue persists, please let us know.
Version: LiteDB v5.0.19
Describe the bug
When processing through records to delete oldest, the following error is thrown:
Current transaction contains open cursors. Close cursors before run Commit()
Code to Reproduce
Expected behavior
In v5.018 and lower, this functions as expected and deletes records.
The text was updated successfully, but these errors were encountered: