How can i use transaction as per my requirement
Hi all i am doing a code to delete the selected employee from the gridview where i can get multiple empids for that i will check for the maximum payperiod if exists i will delete that record if not i will exit.
But in my requirement the statement goes to the procedure where i have written code to delete the record when maximum condition is true.
If i get one condition true and other condition false i would like to roll back the previous which i deleted . Will transaction allow me this kind of process.
My sample code
if(FInd(maxlst))
{
obj.delete(); // Here i wrote the logic to delete
}
else
{
// I would like rollback the previous which i deleted
I am using MYSQL can any one help me
}