This server will be upgraded at 3pm Sydney time on December 3rd (December 2nd, 8pm PST) and will be down for up to 30 minutes.
This documentation relates to an early version of Confluence.
View this page in the current documentation or visit the current documentation home.

Troubleshooting SQL Exceptions

All Versions
Click for all versions
Confluence 2.0 to 2.5 Documentation

Index

If you get an exception similar to one of the following:

org.springframework.dao.DataIntegrityViolationException: (HibernateTemplate): data integrity violated by SQL ''; nested exception is java.sql.BatchUpdateException: Duplicate entry '1234' for key 1
 at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:88)
caused by: java.sql.BatchUpdateException: Duplicate entry '1234' for key 1
 at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:647) 

or

(HibernateTemplate): data integrity violated by SQL ''; nested exception is java.sql.BatchUpdateException: ORA-00001: unique constraint (CONFLUENCE.SYS_C0012345) violated

This document will outline the steps to take to increasing logging on your system. This additional logging will help us work out the cause of this error.

To enable this additional logging:

  1. open confluence/WEB-INF/classes/log4j.properties and uncomment the following lines. The double ## lines are comments, leave them intact.
    ## log hibernate prepared statements/SQL queries (equivalent to setting 'hibernate.show_sql' to 'true')
    #log4j.logger.net.sf.hibernate.SQL=DEBUG, confluencelog
    #log4j.additivity.net.sf.hibernate.SQL=false
    
    ## log hibernate prepared statement parameter values
    #log4j.logger.net.sf.hibernate.type=DEBUG, confluencelog
    #log4j.additivity.net.sf.hibernate.type=false
    
    If you can not locate these lines in your log4j.properties file, please add them to the end of it.
  2. restart Confluence
  3. redo the steps that led to error
  4. zip up your logs directory and attach it your support ticket
  5. if you are using Oracle and got a constraint error, please ask your DBA what table and column that constraint (that is, CONFLUENCE.SYS_C0012345) refers to and add that information to your support ticket.
  6. open confluence/WEB-INF/classes/log4j.properties again and remove the 4 lines you added in step 1 (the additional logging will impact performance and should be disabled once you have completed this procedure.

Related

Enable Hibernate Logging

Oracle Error Codes

Each DB Oracle error has a specific error code and information about them can be located on a http://<ERROR-CODE>.ora-code.com/
For example the above error code http://ora-00001.ora-code.com/

Labels

debug debug Delete
sql sql Delete
properties properties Delete
log4j log4j Delete
logging logging Delete
hibernate hibernate Delete
troubleshooting troubleshooting Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.