Skip to content

Commit d86dbff

Browse files
Updated PR base on comments from code review by codemakerai-dev
1 parent f5759cf commit d86dbff

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

example/OrderDao.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,10 @@ public OrderDao(Session session) {
3636
public void save(Order order) {
3737
checkNotNull(order, "Order cannot be null");
3838

39-
Transaction transaction = null;
4039
try {
41-
transaction = session.beginTransaction();
4240
session.save(order);
43-
transaction.commit();
4441
logger.info("Order saved successfully");
4542
} catch (HibernateException e) {
46-
if (transaction != null) {
47-
transaction.rollback();
48-
}
4943
logger.error("Error occurred while saving order", e);
5044
throw e;
5145
}

0 commit comments

Comments
 (0)