Hibernate closed put outside loop. Threading added not workinG