I am doing registeration process there is 2 tables 1. client 2. serial (has a field with last client no.)
I want to add new client in client table , its number is last client no. +1
what i already did as follows
1. html form for user information 2. jsp confirmation page (gets data from the previous page) it access serial table and gets last client no. it has submit button that add new client to client table 3. jsp page to modify serail table with the new customer no
I am not sure what database you are using but I would recommend that use sequence (Oracle has sequence) to get the next number before you insert into the table. Sequence will always assign next available number to new request even when there are concurrent request to db at the same time. Oracle will handle that far you.
Your issue is that there could be multiple clients who can access the page that assign the next number at the same time.