try {
EntityManagerFactory emf = (EntityManagerFactory) lookup(persistenceUnitJndiName);
EntityManager em = emf.createEntityManager();
UserTransaction t = (UserTransaction) lookup("UserTransaction");
try {
t.begin();
em.joinTransaction();
Object o = persist(em);// do the work
em.flush();
t.commit();
return o;
} catch (Exception e) {
t.rollback();
throw e;
} finally {
em.close();
}
blog to recollect different kinf of data, comments, todo's, and make it easily avalaible from the web
14 abril 2009
D:\Development\TOOLS_HOME\taylor\svn\applications\branches\taylor-tracker-1.1.0\ejb\src\main\java\net\taylor\tracker\web\TransactionScript.java
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario