On 10 June 2014 19:44, ljnelson <ljnel...@gmail.com> wrote:

> On Tue, Jun 10, 2014 at 11:37 AM, Rupert Smith [via OpenJPA] <
> ml-node+s208410n7586817...@n2.nabble.com> wrote:
>
> > The quora link I posted suggests that this will work:
> >
> > 1. Start a transaction.
> > 2. Insert the new entity without checking any condition.
> > 3. Select all entities similar to the one you inserted, using
> > OPTIMISTIC_FORCE_INCREMENT. If it returns more than one entity abort,
> else
> > commit.
> >
> > I couldn't see how that would work, but I haven't tried it.
> >
>
> OK; this will only work if there's some sort of version column in your
> database that can be incremented by the JPA provider (OpenJPA).  Do you
> have a @Version-annotated field or property in your entity?  From your
> earlier posts I was assuming you were working with a legacy schema, most of
> which have no notion of a version-like column.
>

Yes, I have a version column thanks. Its a new schema, just large and
complex and so easy to change in this organization.

I still don't understand how this will work, but perhaps its best if I just
try it first. Thanks for your help.

Rupert

Reply via email to