On Thu, Oct 2, 2008 at 8:18 PM, KiKi <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I know this discussion is quite old, but I was wondering if you could
> elaborate about why storing a scope in a static member is a bad idea.

Basically - none (or almost none) of the classes involved in making AR
work (Session, Scope etc) are thread safe. If they are used from more
than one thread simultaneously then their behavior is undefined. (and
almost certainly wrong/broken/unsafe - e.g. transaction semantics
cannot be guaranteed).

In this scenario - I _think_ I would introduce a service layer (with a
static facade or gateway) which ensured that all DB related requests
were handled by one thread and managed serialising calls from multiple
threads. (The details of this would obviously totally depend on the
exact details of whats going on.)

j.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to