Added support to manage DB sessions using polimorphic factory for different type of adapters.