Jira XML backups may fail with a 'Connection has already been closed' error
Problem
When creating XML backups of large Jira instances, the backup may fail after a few minutes with the following UI error:
The following exception can also be observed in atlassian-jira.log:
org.ofbiz.core.entity.GenericTransactionException: Error occurred while rolling back transaction. (Connection has already been closed.)
at org.ofbiz.core.entity.TransactionUtil.rollbackLocalTransaction(TransactionUtil.java:397)
at com.atlassian.core.ofbiz.util.CoreTransactionUtil.rollback(CoreTransactionUtil.java:47)
at com.atlassian.jira.action.admin.export.DefaultSaxEntitiesExporter.cleanUpAfterEntity(DefaultSaxEntitiesExporter.java:167)
at com.atlassian.jira.action.admin.export.DefaultSaxEntitiesExporter.exportEntity(DefaultSaxEntitiesExporter.java:145)
at com.atlassian.jira.action.admin.export.DefaultSaxEntitiesExporter.exportEntities(DefaultSaxEntitiesExporter.java:100)
at com.atlassian.jira.bc.dataimport.DefaultExportService.exportJIRA(DefaultExportService.java:172)
at com.atlassian.jira.bc.dataimport.DefaultExportService.export(DefaultExportService.java:82)
at com.atlassian.jira.bc.dataimport.DefaultExportService.export(DefaultExportService.java:67)
at com.atlassian.jira.web.action.util.XmlBackup.doExecute(XmlBackup.java:100)
Cause
The backup is taking longer than the specified 'pool-remove-abandoned-timeout' JDBC value in dbconfig.xml, or the 'removeAbandonedTimeout' value in server.xml if using a JNDI connection. The value defaults to 300 seconds.
Resolution
Time how long it takes before the UI error is observed, and then increase the specified timeout to exceed that by 20 to 30 seconds to account for variability. As an example, if the backup takes 6 minutes, increase the timeout value to a minimum of 400 seconds.