WorkerResource workerResource = (WorkerResource) Utils.getResource(ResourceType.GATEWAY_WORKER, gatewayWorker);
em.close();
return workerResource;
}catch (Exception e){
logger.error(e.getMessage(), e);
throw new RegistryException(e);
}finally {
if (em != null && em.isOpen()){
if (em.getTransaction().isActive()){
em.getTransaction().rollback();
}