Re: Some doubts about DataContext and memory allocation

From: mr.abanjo (mr.abanj..mail.com)
Date: Mon Jun 21 2010 - 14:09:25 UTC

  • Next message: Lucas Holt: "Re: Strange Cayenne problem"

    You are right Aristedes.
    Thansk for your support!
    Davide

    On Sun, Jun 6, 2010 at 10:09 AM, Aristedes Maniatis <ar..sh.com.au> wrote:

    > On 23/05/10 5:25 PM, mr.abanjo wrote:
    >
    >> The write operation i perfrom in my site is very simple. It's just an
    >> insert
    >> of two fields in a single table. So maybe also singleton should work,
    >>
    >
    > No, it is still going to be a bad idea. What happens in your application
    > when in one thread you are committing the context and an in another thread
    > you are in the middle of adding records to that same context?
    >
    > Don't have a context which lives across different threads until you really
    > know what you are doing with locking.
    >
    > There is one time that it is common to have a singleton context: a
    > read-only 'shared' context for displaying data. Developers from a WO
    > background will be familiar with this approach. Cayenne doesn't have a
    > special shared context, but you can use it that way if you like.
    >
    > Ari
    >
    > --
    > -------------------------->
    > Aristedes Maniatis
    > ish
    > http://www.ish.com.au
    > Level 1, 30 Wilson Street Newtown 2042 Australia
    > phone +61 2 9550 5001 fax +61 2 9550 4001
    > GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A
    >



    This archive was generated by hypermail 2.0.0 : Mon Jun 21 2010 - 14:09:57 UTC