The connection caching was a little bit too liberal and was caching across databases (I think). No we just grab it when we enter clean. Added an iterator so there isn't too much code duplication between delete and truncate.
Due to pools etc eveything we called connection_klass.connection we would get a different connection. I hit a bug using multiple DBs where eventually the connection that did the referential integrity would not exist anymore and then everything would fail when it tried to reset the foreign keys.
…h version 10+
… to us.
--- As described here http://www.mongodb.org/display/DOCS/Mongo+Metadata MongoDb system collections starts with system. <-- notice the dot at the end, not just with system. This is important becouse when I have system_admins collection in my database it is not truncated. :( So here is a fix for that case.