Confluence Docs 3.0 : Troubleshooting SQL Exceptions This page last changed on Jun 14, 2008 by rhartono. If you get an exception similar to those shown below, it is a good idea to increase the logging levels of your Confluence instance. If you request Atlassian support, this additional logging will help us work out the cause of the error. Increased logging levels will enable us to diagnose errors like these:
    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 outlines the steps to take to increasing logging on your system.
| Changing the logging levels via the Administration Console With Confluence 2.7 and later, you can adjust logging levels at runtime via the Administration Console — read the instructions. Below we tell you how to edit the log4j files directly.
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. Restart Confluence. Redo the steps that led to the error. Zip up your logs directory and attach it your support ticket. If you are using Oracle and received a constraint error, please ask your database adminstrator which table and column the constraint (that is, `CONFLUENCE.SYS_C0012345`) refers to and add that information to your support ticket. 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 TOPICS Enabling detailed SQL logging Working with Confluence Logs Troubleshooting failed XML site backups

Document generated by Confluence on Nov 05, 2009 23:34