> .storeLocked() works very nicely :). So simple, just add 6 letters and
> suddenly a whole better level of data integrity :)
Great!
> I was planning on implementing the audit trail through a JOOQ listener. I'm
> not sure how yet (Like you said with complex data it becomes... complex),
> but at least I can listen for all data changes and then handle the audit
> trail in a single spot rather than through a bunch of DAOs.
Yes, those ExecuteListeners seem to have been a very good addition for
many users. Sounds reasonable to use them for simple generic audit
trails, as well. Maybe, you could use Configuration.getData() /
setData() to communicate with your AuditListener:
http://www.jooq.org/javadoc/latest/org/jooq/Configuration.html#setData%28java.lang.String,%20java.lang.Object%29
That way, you could create your own custom "audit-enabled" Factories.
> The other thing I am thinking about to pre-empt the optimistic locking is an
> automatic change detection (through the form of a periodic refresh, or
> perhaps a listener, but that wouldn't detect non-jooq updates or work in a
> cluster or anything). But that is probably getting too application specific
> to be part of JOOQ.
Sounds like a cache with invalidation mechanisms. jOOQ could have
ResultQuery.fetchLive() methods, which would register fetched "live"
records in a LiveRecordManager. This manager would maintain
WeakReferences to all of those "live" records, in order to
periodically refresh them according to custom configuration
parameters. "Live" records could also allow to register listeners that
will be notified upon refresh.
Apart from the fact that this will be non-trivial to implement
correctly for many user-site platforms (with all the required
synchronisation and thread-safety and performance-tuning), it might be
useful to some jOOQ users.
I'll track this idea as long-term feature request, #1581:
https://sourceforge.net/apps/trac/jooq/ticket/1581
> In any case I'll let you know if I come up with some nice JOOQ extentions.
Great, thanks!
Cheers
Lukas