Our Tridion 2013 SP1 setup, has a deployer which deploys to a broker database. We often get failed and throttled publish transactions. We did some configuration changes with workers et cetera.
Tonight we had no failed transactions, but when I checked the incoming folder of our deployer, I saw like 20 files, which were not cleand up (and this will cause throttled statuses after a while).
In the deployer log i saw the following for one of those transactions:
2017-10-24 08:03:43,320 WARN PreCommitPhase - Failed to Prepare: tcm:0-744408-66560 error: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
This transactions failed 3 times, and after the 4th retry, it succeeded, but the package wasn't removed from the incoming folder.
Question 1: What is causing this error?
Question 2: Why is the incoming folder not cleaned up after the transaction succeeded after a few retries?
ps. cleanup is set to true in deployer config, packages that succeed the first try are cleand up.