ECMS-5265: Close session to avoid memory leak