Confluence 6 SQL 異常的問題解決

若是你獲得了與下面顯示內容相似的信息話,那麼你最好考慮修改 Confluence 的日誌級別輸出更多的信息。若是你考慮經過 Atlassian support 得到幫助,那麼這些詳細的錯誤信息可以更好的幫助咱們找到問題的緣由。java

增長日誌的級別將會讓咱們可以對下面的問題進行診斷:mysql

org.springframework.dao.DataIntegrityViolationException: (HibernateTemplate): data integrity violated by SQL ''; nested exception is java.sql.BatchUpdateException: Duplicate entry '1234' for key 1spring

 at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:88)sql

caused by: java.sql.BatchUpdateException: Duplicate entry '1234' for key 1數據庫

 at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:647) 性能

或者ui

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

這個文檔對若是在你的系統中增長日誌級別,並讓日誌輸出更多詳細信息進行了說明。.net

Changing the logging levels via the Administration Consolehibernate

從 Confluence 2.7 開始,你能夠在你的 Confluence 管理員控制檯中調整日誌的級別——請閱讀 Working with Confluence Logs 頁面中的相關內容。下面咱們將會告訴你如何直接編輯 log4j 文件。

  1. 打開 confluence/WEB-INF/classes/log4j.properties 而後取消註釋下面的行。 ## 行是註釋,請保持這行的完整。

    ## log hibernate prepared statements/SQL queries (equivalent to setting 'hibernate.show_sql' to 'true')

    #log4j.logger.net.sf.hibernate.SQL=DEBUG

     

    ## log hibernate prepared statement parameter values

    #log4j.logger.net.sf.hibernate.type=DEBUG

    (info) 若是你不能在你的 log4j.properties 文件中找到上面的內容的話,請在文件的最後添加上這些內容。

  2. 重啓 Confluence。
  3. 從新操做你出現錯誤的的步驟。
  4. 壓縮你的日誌目錄而後添加到你的支持請求工單中。
  5. 若是你使用的是 Oracle 數據庫同時你收到了一個 constraint error,請詢問你的數據庫管理員是哪一個一個數據庫表和列有約束(例如:CONFLUENCE.SYS_C0012345),得到相關信息後將這些內容添加到你的工單中。
  6. 打開 confluence/WEB-INF/classes/log4j.properties 文件,刪除在第一步中添加的上面 4 行(讓 Confluence 輸出更多的日誌信息將會影響 Confluence 的性能,在生產環境中,你應該不輸出這些信息)。

相關主題

Enabling Detailed SQL Logging
Working with Confluence Logs
Troubleshooting failed XML site backups

https://www.cwiki.us/display/CONF6ZH/Troubleshooting+SQL+Exceptions

相關文章
相關標籤/搜索