Hello. I’m getting `BatchDataInconsistentException...
# exposed
m
Hello. I’m getting
BatchDataInconsistentException
when doing batch insert. It says
Can't add a new batch because columns: tracker.id_tracker don't have default values. DB defaults are not supported in batch inserts
. That said , my column id_tracker is supposed to be auto-generated from a sequence in the database.
1
c
Hi @Mario Andhika
That said , my column id_tracker is supposed to be auto-generated from a sequence in the database.
Could you share how this column (&/or sequence) is being defined in the Exposed table? And the database being used. If the column data is being auto-generated, for example, by something not monitored by Exposed (like a database trigger or a custom
Column.withDefinition()
modifier), it should be marked using
Column.databaseGenerated()
to ensure that Exposed does not fail early on batch insert.
m
Hi Chantal. Thanks for the reply. I found out that I didn’t declare the column as autoIncrement(“sequence_name”). I did that and that solved the problem
1
👍 1