I have three service classes namely -
1. OrderService with method order()
2. CustomerService with method acceptCustomerInfo()
3. PaymentService with method pay()
Name of implementation classes are OrderServiceImpl, CustomerServiceImpl, PaymentServiceImpl.
From these Implementation classes, DAO layer methods are called
1. OrderDAO - order()
2. CustomerDAO - acceptCustomerInfo()
3. PaymentDAO - pay()
Name of implementation classes on DAO layer are : OrderDAOImpl, CustomerDAOImpl, PaymentDAOImpl
These classes actually interacts with the database either through hibernate or simple
jdbc
Now, on front end
i have one button CHECK-OUT, when user clicks on this button all three methods on service layer gets executed in single transaction.
If anyone fails, all should rollback.
how to design/work to ensure this scenario to work correctly???