Available in versions: Dev (3.20)

This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.

Dirty tracking

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

A org.jooq.Record has a set of internal flags used for dirty tracking. The dirty tracking settings allow for specifying whether Record#touched() or Record#modified() flags should be used.

  • TOUCHED: The default is to track any "touching" of a record value, i.e. any call to a Record.set() method, assuming that even if a value hasn't changed, the fact that it was set at all is relevant for triggers, default values, etc. This is a useful default whenever e.g. audit columns, optimistic locking (version columns) or some other auto-updated value is involved.
  • MODIFIED: An alternative is to track only actual value changes, to help minimise database interactions and locking when not necessary in the absence of triggers, default values, locking behaviour, etc.

Example configuration

Settings settings = new Settings()
    .withRecordDirtyTracking(MODIFIED) // Defaults to TOUCHED

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo