Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-11218

Attachment migration from filesystem to database results in DataIntegrityViolationException while removing space

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Medium Medium
    • None
    • 2.5.7
    • None

      The problem of space removal when attachments are stored within the database occurred and generated the following error exception:

      2008-03-25 13:11:45,359 ERROR [http-8484-Processor3] [atlassian.xwork.interceptors.XWorkTransactionInterceptor] onThrowable Invoking rollback for transaction on action '/spaces/doremovespace.action (RemoveSpaceAction.doRemove())' due to throwable: org.springframework.dao.DataIntegrityViolationException: (Hibernate operation): data integrity violated by SQL ''; nested exception is java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (`confdb_257_csp16708/attachmentdata`, CONSTRAINT `FK9DC3E34D34A4917E` FOREIGN KEY (`ATTACHMENTID`) REFERENCES `attachments` (`ATTACHMENTID`))
      
       -- url: /spaces/doremovespace.action | userName: admin
      org.springframework.dao.DataIntegrityViolationException: (Hibernate operation): data integrity violated by SQL ''; nested exception is java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (`confdb_257_csp16708/attachmentdata`, CONSTRAINT `FK9DC3E34D34A4917E` FOREIGN KEY (`ATTACHMENTID`) REFERENCES `attachments` (`ATTACHMENTID`))
      
      java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (`confdb_257_csp16708/attachmentdata`, CONSTRAINT `FK9DC3E34D34A4917E` FOREIGN KEY (`ATTACHMENTID`) REFERENCES `attachments` (`ATTACHMENTID`))
      
      	at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:648)
      

      The same happened while using the embedded DB.

      Steps to replicate:

      1. Migrate attachment storage to database
      2. Delete the space (Please try the space export from CSP-16708)

            shaffenden Steve Haffenden (Inactive)
            meiyan.chan@atlassian.com Mei Yan Chan [Atlassian]
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: