Open cer opened 1 year ago
See https://github.com/eventuate-tram/eventuate-tram-sagas/issues/97
First, reformatInsertParameters() - for Postgres replaces placeholders for null parameters with NULL:
reformatInsertParameters()
NULL
INSERT INTO eventuate.saga_instance(saga_type, saga_id, state_name, last_request_id, saga_data_type, saga_data_json, end_state, compensating, failed) VALUES(:param1, :param2, :param3, NULL, :param5, :param6, :param7, :param8, :param9)
And then bindParameters() does this when the value is null:
bindParameters()
if (!(sqlDialect instanceof PostgresDialect)) { genericExecuteSpec = genericExecuteSpec.bindNull(i, Object.class); } else { // ?? // skippedParameters++; }
This happens when i == 3, which corresponds to the 4th placeholder = :param5.
i == 3
:param5
skippedParameters
i - skippedParameters
See https://github.com/eventuate-tram/eventuate-tram-sagas/issues/97
The problem
First,
reformatInsertParameters()
- for Postgres replaces placeholders for null parameters withNULL
:And then
bindParameters()
does this when the value is null:This happens when
i == 3
, which corresponds to the 4th placeholder =:param5
.Fix:
skippedParameters
and usei - skippedParameters
as the index.