G
getsanjay.sharma
Hello to all programmers out there.
I am currently developing a Java web application using Servlets / JSP.
I was just wondering how I would go about implementing complete commit
or complete rollback. For eg. I have a controller which depending on
the user input would update more than one tables simultaneously. I
want this operation to either completely commit or rollback. Its
something like this:
private void process(..)
{
policyDAO.addPolicy(policyBean); //would add a policy record to
the db
customerDAO.addCustomer(customerBean); // would add a customer
record to database.
...
}
Is there any way for me to make changes to db only when all the
additions are successful? Thanks for your help.
I am currently developing a Java web application using Servlets / JSP.
I was just wondering how I would go about implementing complete commit
or complete rollback. For eg. I have a controller which depending on
the user input would update more than one tables simultaneously. I
want this operation to either completely commit or rollback. Its
something like this:
private void process(..)
{
policyDAO.addPolicy(policyBean); //would add a policy record to
the db
customerDAO.addCustomer(customerBean); // would add a customer
record to database.
...
}
Is there any way for me to make changes to db only when all the
additions are successful? Thanks for your help.