You could use stateful session bean for beginning/committing
transactions and optimistic locking in entity beans.
The possible problem is the transaction timeouts.
Probably, you would like to use Instance Per Transaction container for
this setup.
Alternatively, you have to use value objects are
Title: Optimistic Locking Across Requests
What is the best way to implement an optimistic lock using EJB 2.0 CMP that spans multiple requests? For example, we want to implement optimistic locking on a multipage form submission.
This message and any attachments are intended only for the use