Incluir rollback en excepción

This commit is contained in:
Isidoro Nevares Martín 2025-12-17 17:16:04 +01:00
parent ec673174d9
commit 91aff80cec
2 changed files with 5 additions and 0 deletions

View File

@ -65,6 +65,7 @@ public class ContinenteDaoHibernate implements IOperacionesDAOEntidad<Continente
transaccion.commit(); transaccion.commit();
} catch (HibernateException e) { } catch (HibernateException e) {
transaccion.rollback();
e.printStackTrace(); e.printStackTrace();
} }
} }
@ -82,6 +83,7 @@ public class ContinenteDaoHibernate implements IOperacionesDAOEntidad<Continente
transaccion.commit(); transaccion.commit();
} catch (Exception e) { } catch (Exception e) {
transaccion.rollback();
e.printStackTrace(); e.printStackTrace();
} }
} }

View File

@ -65,6 +65,7 @@ public class PeliculaDaoHibernate implements IOperacionesDAOEntidad<Pelicula, In
transaccion.commit(); transaccion.commit();
} catch (HibernateException e) { } catch (HibernateException e) {
transaccion.rollback();
e.printStackTrace(); e.printStackTrace();
} }
} }
@ -82,6 +83,7 @@ public class PeliculaDaoHibernate implements IOperacionesDAOEntidad<Pelicula, In
transaccion.commit(); transaccion.commit();
} catch (Exception e) { } catch (Exception e) {
transaccion.rollback();
e.printStackTrace(); e.printStackTrace();
} }
} }
@ -106,6 +108,7 @@ public class PeliculaDaoHibernate implements IOperacionesDAOEntidad<Pelicula, In
transaccion.commit(); transaccion.commit();
} catch (HibernateException e) { } catch (HibernateException e) {
transaccion.rollback();
e.printStackTrace(); e.printStackTrace();
} }
} }