Close database session after inserts