Re: Canceling long-running queries

From: Evgeny Ryabitskiy (evgeny.ryabitski..mail.com)
Date: Wed Oct 21 2009 - 05:29:13 EDT

  • Next message: Eric Lazarus: "Updating Cayenne Advice 1.x => 3.0: createAndRegisterNewObject is deprecated..."

    Hello!
    You can create separate DataContext and bind it to your separate
    thread. Then you can stop you thread anytime.
     Also you can bind transaction to thread (if you want to rollback changes).

    See:

    1)http://cayenne.apache.org/doc20/api/cayenne/org/apache/cayenne/access/DataContext.html#createDataContext()

    2) http://cayenne.apache.org/doc20/api/cayenne/org/apache/cayenne/access/DataContext.html#bindThreadDataContext(org.apache.cayenne.access.DataContext)

    3) http://cayenne.apache.org/doc20/api/cayenne/org/apache/cayenne/access/Transaction.html#bindThreadTransaction(org.apache.cayenne.access.Transaction)

    Evgeny Ryabitskiy

    2009/10/20 Lawrence Gerstley <lawger..mail.com>:
    > Hello,
    >
    > If you're using Cayenne as the ORM in a thick desktop client (e.g., RCP),
    > and executing a long-running query, is there a Cayenne methodology for
    > interrupting and canceling such a query, or would one just use normal
    > threading?
    >
    > Thanks--Lawrence
    >



    This archive was generated by hypermail 2.0.0 : Wed Oct 21 2009 - 05:29:49 EDT