Transactional transactional = method.getAnnotation(Transactional.class);
if(transactional == null){
transactional = method.getDeclaringClass().getAnnotation(Transactional.class);
}
TransactionalType type = transactional.type();
if(type != TransactionalType.READOLNY){
entityManager.setNeed2ProcessTransaction(true);
}
final EntityTransaction transaction = entityManager.getEntityManager().getTransaction();