Changes to hibernate listener in order to let him open a single hibernate session instead of two.