Updated the way the SessionFactory is created
Signed-off-by:brian978 <andrei.dincescu@hotmail.com>