}
printDebug("------------------------------------------------------------------------------------");
- EntityManager em = null;
try {
- // EntityManager em = DbUtil.getInstance().getEntityManager();
- em = Persistence.createEntityManagerFactory("SimDeCSPU").createEntityManager();
+ EntityManager em = DbUtil.getInstance().getEntityManager();
executaServico(em, request, response, out);
} catch(Exception e) {
e.printStackTrace();
} finally {
- if (em != null)
- em.close();
-
out.close();
}
}
}
public NegociacaoPedagogica(long idSessao, Paciente paciente) throws Exception {
- //em = DbUtil.getInstance().getEntityManager();
- try {
- em = Persistence.createEntityManagerFactory("SimDeCSPU").createEntityManager();
- SessaoUsuario sessaoUsuario = em.find(SessaoUsuario.class, idSessao);
- this.sessaoUsuario = sessaoUsuario;
- this.paciente = paciente;
-
- // Busca o log de execução
- logExecucao = new LogExecucao(sessaoUsuario, paciente, em);
- } finally {
- em.close();
- }
+ em = DbUtil.getInstance().getEntityManager();
+ SessaoUsuario sessaoUsuario = em.find(SessaoUsuario.class, idSessao);
+ this.sessaoUsuario = sessaoUsuario;
+ this.paciente = paciente;
+
+ // Busca o log de execução
+ logExecucao = new LogExecucao(sessaoUsuario, paciente, em);
}
public String getIntervencao(String etapa) throws Exception {
<a href="simulador/index.html">Acesso ao Simulador</a>
<br/>
<br/>
- <h:outputText value="Versão 4.2" />
+ <h:outputText value="Versão 4.2.0" />
</center>
</h:body>
</html>