Added garbage collection to database sessions