Closed InesCodMon closed 3 weeks ago
I encountered the same error while migrating from v5.0.17 to v5.0.19
LiteDB.LiteException: The current thread already contains an open transaction. Use the Commit/Rollback method to release the previous transaction. at LiteDB.Engine.LiteEngine.DropCollection (System.String name) [0x0003e] in <757508dac4404cdea3f8947f089148e1>:0 at LiteDB.LiteDatabase.DropCollection (System.String name) [0x00013] in <757508dac4404cdea3f8947f089148e1>:0
I tried both Commit and Rollback before performing the drop, but it didn't work. I think for now I'll revert back to version 17.
I encountered the same error while migrating from v5.0.17 to v5.0.19
Same.
Thank you for reporting this issue.
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 v5.0.18 and v5.0.19 /MacOS/.NET Standard 2.0
Describe the bug I want to clean up the database (remove all collections and their content). But an error occurs when DropCollection is called the first time.
Code to Reproduce public void CleanupDatabase() { IEnumerable listOfCollections = _db.GetCollectionNames();
foreach (string item in listOfCollections)
{
Console.WriteLine("COLLECTION" + item.ToString());
_db.DropCollection(item);
}
}
Expected behavior All collections should be removed. The above code is expected to work the same as it does in version v5.0.17.
Screenshots/Stacktrace The below error occurs when the DropCollection method is called.
LiteDB.LiteException: The current thread already contains an open transaction. Use the Commit/Rollback method to release the previous transaction. at LiteDB.Engine.LiteEngine.DropCollection (System.String name) [0x0003e] in:0
at LiteDB.LiteDatabase.DropCollection (System.String name) [0x00013] in :0