Hi all, Ours is a WebServices application. Whenever a request comes it is first checked for duplicate transaction from the table. If a duplication transaction ID exists the request is rejected else it is processed and at the end...the record is inserted in the database.
Now the problem is if 2 or more requests having same id comes at same time...the application process them paralelly and unable to identify duplicate id and finally getting inserted in database after completion of process.
Unique Constraint will only help in not inserting duplicate row...but before that the actual processing has already taken place.
Is there any way in JDBC to check for duplicate records at the same time.
"Jumbalika", We're pleased to have you here with us in the JDBC forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
"Jumbalika", you had already been asked before (in this topic) to adjust your display name to confirm to JavaRanch standards. This is not optional. Be aware that accounts with invalid display names are subject to removal.
You should be storing the request in the database before processing it. This helps in 2 ways
a) you will be able to detect duplicate requests b) In case your application stops because of critical error or the server is rebooted, you will hae the request saved in the database. So, when you start your application back again, you can process the rquest again