DML batch delete re-firing SQL from previous calls

Description

I was using HQL DML to delete entities in batch, but noticed the longer the process ran, the # of entities I was deleting per second was decreasing. When I dumped the stack, was always in MySQL transmission, not in hibernate code. When I enabled SQL dumps, I saw sql from previously deleted entities being re-fired, which explained the exponential slowdown of my application.

I traced it to code that is invoked when a BulkIdStrategy is required. In my case, I'm using InlineIdsInClauseBulkIdStrategy and had a joined inheritance mapping requiring multiple deletes from child tables. It appears the DML query is being cached and within AbstractInlineIdsDeleteHandlerImpl, there is a "deletes" member variable that is being appended to on each execution.

Output:

Environment

None

Status

Assignee

Unassigned

Reporter

Scott Werner

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure