[Database]When call close, close opened database object

Signed-off-by: Ethan Shan <shan0xiao0xi@gmail.com>