closeEntityManager in finally block; renewed license headers.