Thanks Lukas for following up.

We are using Jooq version 3.8.2.

Here's the code:

private void deleteRecordsByPk(Collection<R> records) {

   // Execute a batch DELETE
   if (records.size() > 1) {
      // TODO: Figure out why batch delete is not working.
      // TODO: http://stackoverflow.com/questions/38108847
      dslContext().batchDelete(records).execute();

      // The following alternative of single-record deletes does work.
      //dslContext().attach(records);
      //records.forEach(UpdatableRecord::delete);
   }

   // Execute a regular DELETE
   else if (records.size() == 1) {
      dslContext().attach(records);
      records.iterator().next().delete();
   }
}


On Thursday, June 30, 2016 at 6:49:15 AM UTC-4, Lukas Eder wrote:
>
> (for the record / for future visitors: this question was also posted on 
> Stack Overflow: http://stackoverflow.com/q/38108847/521799)
>
> 2016-06-30 12:48 GMT+02:00 Lukas Eder <[email protected] <javascript:>>:
>
>> Hi Jacob,
>>
>> Thanks for your enquiry. What jOOQ version are you using? And could you 
>> please post the Java code that you used to produce this behaviour?
>>
>> Best Regards,
>> Lukas
>>
>> 2016-06-29 21:49 GMT+02:00 Jacob G <[email protected] <javascript:>>:
>>
>>> When I try to do a batch delete, nothing happens. I stepped int other 
>>> debugger, and see that BatchCRUD::executeAction calls 
>>> UpdatableRecord::delete, and down in the callstack, 
>>> UpdatableRecordImpl::checkIfChanged calls fetchOne() which throws a 
>>> QueryCollectorSignal. The sql executed works fine in PGAdmin (postgres), so 
>>> I'm wondering what's going on here? How do I do a proper batch delete?
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "jOOQ User Group" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected] <javascript:>.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to