JPA 2.0 Criteria Lazy Container optimistic locking

Hello Jean-François.

Thank you very much for creating JPA 2.0 Criteria Lazy Container. I’m a newbie to JAVA, Vaadin, and JPA. It appears the JPA 2.0 Criteria Lazy Container will work very nicely for my application. Does JPA 2.0 Criteria Lazy Container support optimistic locking? or any other locking mechanism? Thanks very much in advance for your reply.

Cheers,

Dana Glatz

Locking is pertinent when modifying entities. The container does not modify entities. So if you take an item out of the container and manipulate the entity or entities that underpin that item, you are free to update them as you wish, with whatever locking policy you want.

So in short, if you set your locking policies on the JPA entities appropriately, you should get the exceptions when/if modification conflicts occur, and this is independent of the container used to retrieve/display the information. The code that will need to be exception aware is likely in your forms and (if you make them editable) your tables.