![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
26/01/2012, 14:09
|
| | Fecha de Ingreso: agosto-2011 Ubicación: Madrid
Mensajes: 185
Antigüedad: 13 años, 5 meses Puntos: 29 | |
Respuesta: Duda jta jpa2 Así es. Podrías capturar una excepción y hacer un rollback si ocurrió algo:
} catch(Exception ex) {
em.getEntityManager().rollback();
} finally {
em.close(); //cerramos siempre el EntityManager al acabar la transacción |