Replaced session.beginTransaction() and session.getTransaction().commit() with @Transactional annotation.