can anybody explain me if singletons can be used in ASP.NET 2.0
applications without being shared by multiple users/sessions? The
problem is that my application is using another library which
internally uses singletons, which should not be shared across multiple
users (one of the things they have in there is DB transaction manager).
Any suggestions would be greatly appreciated.
Regards,
Dmitry.I have a singleton (web style) object that I created to store objects.
http://spaces.msn.com/sholliday/ 10/24/2005 entry
My approach was that by piggy backing off the Session object... each
user gets their own version...much like a winform app would work.
I only store simple objects in mine .. (aka, what I've tested)...
mainly dealing with UI ... how I move from 1 page to the next with out
hard coded hrefs in the pages.
Anyway, take a look...but I'd say the idea is that you'd have 1 per
user.. by piggybacking off the Session object.
I use guids for my Users to ensure no conflicts, fyi.
Dmitry wrote:
> Hi,
> can anybody explain me if singletons can be used in ASP.NET 2.0
> applications without being shared by multiple users/sessions? The
> problem is that my application is using another library which
> internally uses singletons, which should not be shared across multiple
> users (one of the things they have in there is DB transaction manager).
> Any suggestions would be greatly appreciated.
> Regards,
> Dmitry.
Singletons is a design pattern.they can be used with asp.net if designed
correctly.
the issues with asp.net is that thread local storage can not be used as the
thread can change while processing the request (casing the data to
disappear). if your library has any static variables, and they are not to be
shared across all thread and users then your library won't work.
-- bruce (sqlwork.com)
"Dmitry" <dpristin@.gmail.com> wrote in message
news:OEwVly4UGHA.1728@.TK2MSFTNGP11.phx.gbl...
> Hi,
> can anybody explain me if singletons can be used in ASP.NET 2.0
> applications without being shared by multiple users/sessions? The problem
> is that my application is using another library which internally uses
> singletons, which should not be shared across multiple users (one of the
> things they have in there is DB transaction manager). Any suggestions
> would be greatly appreciated.
> Regards,
> Dmitry.
Thanks Bruce,
I guess I'm in trouble now. But what about all those rumors that ASP.NET
sessions would run in separate app domains, not threads? That would
ensure that address space is not shared between different sessions?..
Bruce Barker wrote:
> Singletons is a design pattern.they can be used with asp.net if designed
> correctly.
> the issues with asp.net is that thread local storage can not be used as the
> thread can change while processing the request (casing the data to
> disappear). if your library has any static variables, and they are not to be
> shared across all thread and users then your library won't work.
> -- bruce (sqlwork.com)
>
>
> "Dmitry" <dpristin@.gmail.com> wrote in message
> news:OEwVly4UGHA.1728@.TK2MSFTNGP11.phx.gbl...
>> Hi,
>>
>> can anybody explain me if singletons can be used in ASP.NET 2.0
>> applications without being shared by multiple users/sessions? The problem
>> is that my application is using another library which internally uses
>> singletons, which should not be shared across multiple users (one of the
>> things they have in there is DB transaction manager). Any suggestions
>> would be greatly appreciated.
>>
>> Regards,
>> Dmitry.
>
0 comments:
Post a Comment