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

XMLWordPrintable

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Medium
    • None
    • Affects Version/s: 2.5.7
    • Component/s: 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)

            Assignee:
            Steve Haffenden (Inactive)
            Reporter:
            Mei Yan Chan [Atlassian]
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: