Re: Stored Procedure Query and Transactions

From: tnaki..ofthome.net
Date: Sat Mar 05 2005 - 10:20:55 EST

  • Next message: Jürgen Saar: "Re: application scope for a datacontext ?"

    Andrus Adamchik wrote:

    >Forget Spring ... It'll work of course, but I am overcomplicating the
    >issue and really need more coffee. You can do a one-off transaction, while
    >keeping clean implicit transaction handling everywhere else. And can't be
    >any simpler than that:
    >
    >List queries = new ArrayList();
    >queries.add(query1);
    >queries.add(query2);
    >
    >// this will run both queries in the same transaciton
    >// doing a rollback on failure
    >dataContext.performQueries(queries, new QueryResult());
    >
    >
    Does the same apply to a context.commitChanges() operation after a
    number of in-memory objects have been created or modified?
    What I'm currently doing is trying to find out how to execute the
    following transaction:
    create and register an instance of entity A
    read an instance of entities B and C using DataObjectUtils.objectForPK
    modify properties of B and C instances
    do a context.commit

    Does Cayenne execute this as a single transaction without any manual
    transaction handling?



    This archive was generated by hypermail 2.0.0 : Sat Mar 05 2005 - 10:19:04 EST