79258266

Date: 2024-12-06 14:09:19
Score: 0.5
Natty:
Report link

Do it in two phases:

Phase 1:

get the monthly sales from the DB
if it does not exist {
  try {
    create it
    persist it
    flush
  } catch(exception when already exists) {
    // ignore
  }
} else {
  flush
}

Phase 2 in a transaction:

get the monthly sales from the DB
lock it
update it
commit
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: gle