Bruce Snyder wrote:

I'm not following your example completely so let me pose a simple scenario
for demonstration purposes:

    1) Tx1 reads an instance of ObjectA from persistence
    2) Tx2 reads an instance of ObjectA from persistence
    3) Tx1 changes a value in the ObjectA instance and persists it. This
       means that tx2 now is out of sync.
    4) Tx2 changes a value in the ObjectA instance and attempts to
       persist it but receives a ConcurrentModificationException. This
       is correct behavior

Castor does not provide a method of synchronizing the object
instances. This is left up to the application because there is no easy,
universally acceptable method of achieving this type of behavior.

Let's replace step 4 for a moment:


4) Tx2 uses values from ObjectA for displaying in a web page.

This step can occur repeatedly, and can also occur before step 3.

What is the best/easiest way to always get the actual values with step 4, without loading the instance from the database on each invocation (e.g. by using db.load() again)?

Regards,

Andreas

----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev




Reply via email to