i am making a website using spring and hibernate framework.I want to implement auto delete user after 48 hrs of signup if not confirmed.i am new to this so i have no idea how to trigger the controller for auto delete.please help.
Asked
Active
Viewed 115 times
2 Answers
0
You probably can get some idea how to do what you wanted to do here. Spring's TaskScheduler (interface) has a schedule method that allows you to set date (and time) when should the task (runnable) be performed. You might want to schedule this task (everytime user register) to be triggered after 48 hours in your "user signup controller".

Community
- 1
- 1
0
You may want to give the user table two fields: date of registration and has confirmed. Then use the task scheduler to run a task every x minutes to delete rows older than 48 hours that haven't been confirmed. Otherwise every time you reboot the server or redeploy you'll have 48 hours worth of users who never confirmed getting in.

Brent Sandstrom
- 841
- 10
- 16