Ok thanks for the explanation.
Our use case is we have a DefaultRecordListener that overrides the 
storeStart and insertStart methods to populate some created_at and 
modified_at fields that all our tables have.
However, in one area we are performing a bulk insert using the 
DSLContext.insertInto(Table, Fields) syntax.
I tried registering a DefaultExecuteListener but all that gives me access 
to is an ExecuteContext which doesn't seem to provide any methods to modify 
the statement. To me that would seem the most logical place to provide some 
hooks to modify the query before being executed.

Thanks again,
James

On Wednesday, November 4, 2015 at 4:30:09 AM UTC-6, Lukas Eder wrote:
>
> Hi James,
>
> Your observation is correct and it's the expected behaviour. The 
> RecordListener SPI is intended to intercept only calls on the TableRecord / 
> UpdatableRecord APIs' store(), insert(), update(), delete(), refresh() 
> calls. It cannot intercept arbitrary SQL statements the way SQL triggers 
> can. An example: If you run a bulk UPDATE statement, jOOQ will not be able 
> to intercept individual row updates as this knowledge is available only to 
> the database. Even worse: jOOQ has no idea what will happen behind the 
> scenes of a SQL MERGE statement.
>
> Perhaps, we can find a missing feature or a more subtle flaw though. Would 
> you mind explaining your use-case a little more, so we can see what would 
> be the best way for you to go forward?
>
> Looking forward to hearing from you again,
> Lukas
>
> 2015-11-03 18:05 GMT+01:00 <[email protected] <javascript:>>:
>
>> We have set a DefaultRecordListener in our jOOQ configuration and it 
>> works when calling things like DSLContext.newRecord(). However, when doing 
>> an insert using DSLContext.insertInto() our custom RecordListener is not 
>> getting called. Is that expected or a bug?
>>
>> Thanks,
>> James Lorenzen
>>
>> -- 
>> 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