Implemented pinning of database.
Added database unpin.