REIVEW: [NX-518] Orient database manager

This PR addresses the following issues:

https://issues.sonatype.org/browse/NX-518
https://issues.sonatype.org/browse/NX-519
https://issues.sonatype.org/browse/NX-542
ha, well, by "the code", i meant "the nexus code", not just this bit. i've noticed it a few times. i just have an irrational fear of IOExceptions. one bit me as a child.