Problem is that the DecrementJobRetiesCmd is using the same transaction (and the same underlying JDBC connection) as the failing job.
Since the DecrementJobRetriesCmd is called in a transaction listener on event ROLLED_BACK, I think something is wrong in transaction handling, since the already rolled-back transaction is used.
After the DecrementJobRetiesCmd has been executed, the exception thrown from the job (what the test is all about) is rethrown. After this, the log mentions this:
Logging comes from the org.springframework.transaction.support.TransactionTemplate class, which rolls back the transaction when an application exception occurs, which causes a rollback to be performed on the SQLConnection.
Connection (conn4) is the same connection that is used when starting the ExecuteJobCmd.
@see ByteArrayEntity and VariableInstanceEntity.getByteArrayValue
introduce JobEntity.exceptionByteArray