1) In Cayenne Modeler, select an ObjEntity (the Java class) and
under the Entity tab, turn Optimistic Locking on. Then under
the Attributes tab, turn Used for Locking on for each attribute
you wish to lock on (you can do the same for Relationships if you
Thanks, that's what I missed.

Oh right, it's in the FAQ, not in the JavaDoc.
Finally thought of asking Google. D'oh.

Though the only other page that mentions it is
https://cwiki.apache.org/CAY/cayenne-in-motion.html . (It's ancient,
uses Cayenne 1.1 or 1.2. Not sure whether it's still up-to-date. I
tend to avoid ancient examples, which is why I missed that one in the
first place.)

The Javadoc for the commit functions should at least mention that
they might throw an optimistic locking exception. And what the class
of that exception is so people can write try...catch clauses.
And the Cayenne user guide should mention it, as part of the commit
stuff (here we're back at transactions ;-)). And maybe there should
be mention how to enable it if one is not using Modeler.

Sorry for all those nitty-gritty details, and I apologize for the
inconvenience if I just overlooked it in the docs.

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 16 of 20 | next ›
Discussion Overview
groupuser @
postedFeb 18, '12 at 2:48p
activeFeb 23, '12 at 10:31a



site design / logo © 2022 Grokbase