improve SqlService dbWrite's error detection for the condition "record already exists"
Description
Have the false return from dbWrite, which means that the insert failed due to the record already exists, meaning we get a duplicate entry or unique constraints violated error, be only from this condition, and to do so without logging.
Any other condition will log big time and throw a big fat RuntimeException to cause things to stop dead in its tracks.
Task completed - please open reports of any bugs found
Clay Fenlason May 23, 2006 at 8:57 AM
New WARN with .002 tag on qa1-us:
WARN: Unsuccessful schema statement: alter table SAM_SECTION_T add constraint FK364450DA694216CC foreign key (ASSESSMENTID) references SAM_ASSESSMENTBASE_T (2006-05-23 08:50:36,987 main_org.sakaiproject.springframework.orm.hibernate.AddableSessionFactoryBean) java.sql.SQLException: ORA-02275: such a referential constraint already exists in the table
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623) at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:112) at oracle.jdbc.driver.T4CStatement.execute_for_rows(T4CStatement.java:474) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1028) at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1451)
Have the false return from dbWrite, which means that the insert failed due to the record already exists, meaning we get a duplicate entry or unique constraints violated error, be only from this condition, and to do so without logging.
Any other condition will log big time and throw a big fat RuntimeException to cause things to stop dead in its tracks.