Collection is not present or database is deleted or close error throwing while writing in database!

Error Domain=CouchbaseLite Code=6 “Invalid collection: either deleted, or db closed” UserInfo={NSLocalizedDescription=Invalid collection: either deleted, or db closed}

This error I am getting while Pushing some data to couchbase while debugging i got know database is open by checking it’s path and count, one more thing collection also get created with given name.

But somehow couchbase throwing the above error and after this error for another saving operation on the database i getting the below error
**Error Domain=CouchbaseLite Code=1 “Assertion failed: !_inTransaction” UserInfo={NSLocalizedDescription=Assertion failed: !_inTransaction}
**
Thank you for help!!

This error means that you are holding an invalid collection object. The transaction error indicates the app tries to do something on the database that requires transaction. Not sure whether it’s related to the creation of the new collection.

If you have the logs to share, we could take a look at it as what functions triggered those errors.

Thanks, I found the issue. It was actually related to two database instances being created. While one instance was being deallocated for some reason, the other one was getting closed. This turned out to be the root cause of the problem.