1

i want to rollback deleted table after 20 minutes.

can i do it with or without transaction.?

Parmar Kamlesh
  • 151
  • 1
  • 15

1 Answers1

2

You always have a transaction. As long as it's not committed you can perform a rollback. But it sounds like you want to roll back to a specific point. If so, you can define a savepoint:

SAVEPOINT mySavePoint;

-- Do something

ROLLBACK TO mySavePoint;

savepoint commit rollback in mysql

kara
  • 3,205
  • 4
  • 20
  • 34
  • 1
    No. And you shouldn't try to roll back to a specific time. I don't know what you're going to build, but it sounds very hacky. If you roll back to a time you dont know what you're going to revert. Why do you want to do this? – kara Dec 07 '17 at 10:44
  • You could implement a flag "interview completed" and a job which checks if there are outdated interviews which don't have the flag and delete them. This way the job could gather some data about how far the interview went before the user stopped. Could be interesting how long a user keeps answering and which questions make the user stop. – kara Dec 11 '17 at 10:11