We get the following errors while calling the detailed Confluence Cloud API endpoints in batch (tens of calls).
- The calls are made consecutively (errors occurs whatever the delay between 200ms and 5000ms between each call).
- The errors are intermittent: about 50-70% of calls end up with one or the other of the errors.
- The errors occur unevenly, and don't seem to have any logic regarding what call works or not. For instance, in a process deleting all the children Pages of a parent Page, about half of the calls will fail on first execution (deleting about half of the Pages), then about 50% on the remaining pages on the 2nd second call, and so on until all the remaining pages are dseleted.
- On the POST endpoint below, about 75% of the calls fail.
Error 1:
org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only
Error 2:
org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is net.sf.hibernate.JDBCException: Unable to acquire JDBC Connection
REST API calls generating a random mix of these errors:
axios.default.
delete(`
[our domain]/wiki/rest/api/content/${childPage.id}`,
{
headers: {
"Authorization": `Basic ${TOKEN}`,
"Accept": 'application/json',
"Content-Type": 'application/json'
}
});
axios.default.
post('
[our domain]/wiki/rest/api/content',
reqBodyData,
{
headers: {
"Authorization": `Basic ${TOKEN}`,
"Accept": 'application/json',
"Content-Type": 'application/json'
}
});
Please can you advise what triggers those errors and how to run these APIs, at least consecutively, in an efficient manner (i.e. without too much delay between each call), without getting these errors?