Mixing object and id-based access in a single transaction

From: Heiko.Erhard..i-de.com
Date: Fri Jan 27 2006 - 11:38:53 EST

  • Next message: Bryan Lewis: "orderList() on non-DataObjects?"

    We need to insert the following information into the database in a single
    transaction:

    - A regular Cayenne object (e. g. a 'Project') that is described in the
    mapping file
    - Several tables that depend on the Project (i. e. use the primary key of
    the Project as their foreign key).

    However, there are no mapping descriptions for the dependent tables. We
    just know table names, column names and values.
    We use an InsertBatchQuery to insert the table data.

    The problem is the foreign key of the dependent tables.
    This key is generated when the Project table is saved, i. e. commitChanges
    is called.
    commitChanges implicitely begins and commits a database transaction.
    We would like to include the operations done by our custom InsertBatchQuery
    into this transaction.

    Is there a way to do this (or to externalize the transaction control, i. e.
    control begin and commit time of the transaction ourselves).

    Any help highly appreciated!

    --
    Heiko Erhardt
    



    This archive was generated by hypermail 2.0.0 : Fri Jan 27 2006 - 11:39:04 EST