concurrent modification exception (cayenne 3.0 branch, remote persistence)

From: Marcin Skladaniec (poldwusmoko..mail.com)
Date: Tue Jul 04 2006 - 00:05:10 EDT

  • Next message: Andrus Adamchik: "Remote Object Persistence Tutorial"

    Hi everyone !

    I have this mysterious problem: I'm committing a dozen different records in
    one go (payments, payer, invoices, accounts etc). Right after the commit
    (when state of some records changes to PersistentState.COMMITED) I create
    and commit some extra records and than I commit those new records again
    (separate context, all happening on server). All nice. All records saved. No
    problem. Than right after after the persistent state is changed I get
    "concurrent modification exception", and context on client is returning this
    exception, trying to revert changes (but there is nothing in the context)
    etc. If I don't restart the application, just create a new context and
    repeat the whole process again it works. I though "strange" and I started to
    debug the problem.
    First I wrote a piece of code which steps thru all records in the context
    and prints their attributes and relationships just before the commit to see
    what is actually commited, and ... everything works without throwing any
    exception.
    Than I looked at cayenne code to find what can be causing the concurrent
    modification exception. My suspect is call to clear() in graphCommited() in
    ObjectContextStateLog, but why ? What I'm I doing wrong so the first time it
    fails only for the first time, and only if some objects are not faulted ? I
    don't know which objects are actually causing this problem, because if I try
    to debug them on client I have to fault them, and this is preventing
    exception, and on server I have no real hook to see what is going to be
    committed.

    Marcin

    PS. I'm subscribed to the list, but I had to sent this email from different
    account.

    -------------------------->
    ish
    http://www.ish.com.au
    Level 1, 30 Wilson Street Newtown 2042 Australia
    phone +61 2 9550 5001 fax +61 2 9550 4001



    This archive was generated by hypermail 2.0.0 : Tue Jul 04 2006 - 07:04:40 EDT