Error duplicate key
Posted on 2004-09-20
I have method insert(UserData ud)(Servlet) to insert array UserData into DB(Postgres 7.1) when user click Submit button (JSP)
My problems are when more than a user click Submit button simultaneously, Error duplicate key throw.
Before inserting call method ret = getMaxValues() that return max value of primary key from DB and plus 1.
Primary key in each SQL statement has value is ret ++.
Anyone has experienced my problems, please help.
Thank in advance.