Cayenne 2.0: obtaining a shared DataContext

From: Marc A. Donis (mad..unbox.com)
Date: Sat Oct 27 2007 - 15:25:20 EDT

  • Next message: Aristedes Maniatis: "Re: Cayenne 2.0: obtaining a shared DataContext"

    Hi,

    Long time EOF user, new to Cayenne.

    I would like to keep my read-only reference data in a shared DataContext, so
    that I don't have to save a copy of the reference CayenneDataObjects in each
    user's own DataContext. I've tried fetching my ref data into a DataContext
    created with:

    DataContext.createDataContext(true);

    but that didn't seem to do the trick. I get an exception indicating that I
    am not allowed to create a reference between objects in two different
    DataContexts. Clearly, this is true... unless one of the DataContexts is a
    shared DataContext (at least, that's how it works in EOF).
    What is the right way to obtain a shared DataContext? Or am I going about
    this all wrong?

    tia,
    Marc



    This archive was generated by hypermail 2.0.0 : Sat Oct 27 2007 - 15:28:12 EDT