This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Consider am using java , struts, hibernate and oracle. How can i prevent duplicate entries stored in
database. One way is to make field as Unique . For example i am entering name "prakash" in jsp page ,
prakash is already available means how can i prevent it.
Of course, that is not going to be a 100% guaranteed mechanism. How do you prevent another process inserting duplicate data after your check but before your insert without pessimistically locking the table? And why use pessimistic locking when databases provide a mechanism already in the form of unique indexes?