Re: Newbie: connected user

From: Mike Kienenberger (mkienen..laska.net)
Date: Mon Jan 10 2005 - 21:21:45 EST

  • Next message: Borut Bolčin: "[solved] Create table via API (was Indices)"

    Koka <22605..mail.com> wrote:
    > Anyway, doubt there's any easy way if I stick to 'mostly default -
    > rarely user connection' style. For definiteness let me assume most of
    > my users are browsing artists/galleries so application uses shared
    > datanode, and only rarely some advanced users need to add a painting
    > and there's only database-level protection. Even if I manage to use
    > not-shared datanode specifically for addPainting page I think I'll get
    > 'different DataContext' error because Artist object for addPainting
    > page is set from the shared BrowseArtists page.

    No, the only real trick to to make sure that whenever you have an advanced
    user session, you create a separate DataNode/DataContext(and possibly
    DataDomain) to handle it.

    There's no problems with 'different DataContexts' because, once everything
    is loaded into memory, it all looks the same to Cayenne. The DataSource is
    only used to read and write to the database, not anywhere else. Even in
    "default" cayenne, one DataSource might be used to read the data in, and
    another DataSource might be used to write it back out (assuming connection
    pooling).



    This archive was generated by hypermail 2.0.0 : Mon Jan 10 2005 - 21:21:46 EST