Question
Deleting more than 1 row from a DB table.
Hi all,
My problem is that I am trying to delete multiple rows from a DB table at once. All the rows I'm trying to delete have the same PK as the PK is a FK from another table. This is the code I thought would work but didn't:
- = {
a!forEach(
items: pv!CTI_mnthlyrevene_cntrctmnths,
expression: a!entityDataIdentifiers(
entity: cons!CTI_ENTITY_MRCM,
identifiers: fv!item.ctmnthlyrvCntrctmnthRcrdd
)
)
}
I've tried not using the foreach and it still gives me the exact same error:
- An error occurred while trying to delete data. No data was deleted. Details: javax.persistence.PersistenceException: org.hibernate.jdbc.BatchedTooManyRowsAffectedException: Batch update returned unexpected row count from update [0]; actual row count: 4; expected: 1 [entity name=CTI_mnthlyrevene_cntrctmnths, id=353]
Does anyone have a suggestion on what I should do? I need to delete multiple rows at once from the same table that have the same PK. Please let me know if this is even possible.
