0

I wonder if is possible to manually set writecount property on a batchlet in order to log result on STEP_EXECUTION.WRITECOUNT field's table.

This is my pseudo code

@Inject
EntityManager entityManager;

@Inject
private Logger logger;


@Transactional(Transactional.TxType.REQUIRED)
public void executeQuery(String query) {

    final int output = entityManager.createNativeQuery(query).executeUpdate();

    logger.info("rows updated: {}", output);
}
Fabrizio Stellato
  • 1,727
  • 21
  • 52

1 Answers1

1

STEP_EXECUTION.WRITECOUNT column in the table is not applicable to a batchlet step. If you set data to it, it will still be meaningless. But I think if you somehow set this value in your batchlet, it will be persisted to the job repository.

cheng
  • 1,076
  • 6
  • 6
  • Hmmm, this answer sounds a lot different to my similar question in https://stackoverflow.com/a/64196371/4222206 – Queeg Oct 05 '20 at 06:48