This rule detects manual handling of transactions in SAP Commerce. This is error-prone and SAP commerce provides a reasonable alternative out of the box.
Transaction transaction = Transaction.current();
transaction.begin();
try {
// some stuff that might fail
transaction.commit();
} catch (Exception e) {
transaction.rollback();
// handle the exception
}
Transaction transaction = Transaction.current();
transaction.begin();
Object result = null;
try {
// some shifty stuff that might fail
result = transaction.execute(new TransactionBody() {
// do some stuff that might fail
});
} catch (Exception e) {
// handle exception without transaction hustling.
}