Lightroom SDK: Catalog update access contention/arbitration

  • 2
  • Problem
  • Updated 4 years ago
  • Solved
Presently, there are many plugins that may access the catalog briefly to update it in background threads.

If any other plugin tries to access it for writing at the same time there will be an error in the plugin making the denied attempt.

I have solved this problem for myself, and published the solution in the SDK forum and at
https://www.assembla.com/spaces/lrdev...
(in a nutshell: parse error message to determine if error was in operation function or catalog accessibility, and if the latter, hold-off for a random time period between .1 and 1 second then try again, until succeed or give up...)

however I'm sure not all plugin author's are accounting for this possibility, which may make them appear flaky (depending on the complement of other plugins installed), and the root of the problem being in a different plugin, makes it hard for the author of the seemingly flaky plugin to reproduce & fix...

Perhaps an optional "wait-time" parameter to the with-do writing gates, and associated documented status returned to indicate catalog access was unobtainable (distinguishing condition from catalog update function error), so plugin authors could handle catalog update access errors more gracefully.

If Adobe ever changes the error message thrown when catalog inaccessible, my solution will break...

Cheers,
Rob
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 384 Reply Likes

Posted 7 years ago

  • 2
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 384 Reply Likes
Official Response
This problem can be marked "solved".