Remove hibernate dependency, and only init hibernate session if hibernate is present.