Re: distributed transactions

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Nov 06 2003 - 11:34:06 EST

  • Next message: Mike Block: "using cayenne data connection pools with struts."

    On Nov 6, 2003, at 11:15 AM, Mike Kienenberger wrote:

    > Andrus Adamchik <andru..bjectstyle.org> wrote:
    >> Cayenne definitely supports access of multiple databases from the same
    >> DataContext. I believe there is still an (easy to fix) issue in the
    >> DataContext underlying commit mechanism that internally commits
    >> individual DB transactions independently. It is on my list of things
    >> to
    >> fix.
    >
    > Just out of curiosity, is there a generic technique for committing a
    > "distributed" transaction atomically? Or can that only happen on a
    > per-database basis?

    This works on assumption that the SQL statements fail early if things
    go wrong, not waiting till commit is executed, and do not fail in
    "commit" itself. So if things fail while running statements over one of
    the multiple connections, we still have a chance to rollback all others
    as well.

    I must admit, this is probably too naive. E.g. on Oracle you can have
    deferred constraint checking... I would imagine it failing in commit if
    constraints are not satisfied.

    A more robust implementation would require using JTA, which we are
    planning to do.

    Andrus



    This archive was generated by hypermail 2.0.0 : Thu Nov 06 2003 - 11:34:10 EST