Dorababu Meka

Dorababu Meka

  • 226
  • 8.3k
  • 1.7m

How can i use transaction as per my requirement

Sep 10 2011 12:32 AM
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
}

Answers (5)