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
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
The text was updated successfully, but these errors were encountered:
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.
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
The text was updated successfully, but these errors were encountered: