S
Sgt. Sausage
This may not be the best place to post this, but I'm
coding in c# and, well this group is a "csharp" group!
Background -- We encapsulate data access for an application
through a home-grown "DataEngine" object. This object follows
the singleton pattern. All is well and good, and everything
works just great for our desktop apps that hit the database
through the DataEngine.
Now, we've got to expose the DataEngine object to a web
server. Initially, I'm concerned. I don't do much (any)
web programming, but I've got a good feel for how it works.
My concern is that the DataEngine, being a singleton, will
be shared amongst all user sessions on the web server for
this site. This brings up 2 related major issues that I
have no clue on.
(1) Multi-threading. The DataEngine is not "thread-safe".
It assumes a single user. This was a good, valid assumption
based on the way we build our desktop apps.
(2) If I start locking things up to make it "thread-safe",
I believe I'm in a world of hurt as far as the DataEngine
becoming a bottleneck on the web server.
Do these concerns make sense? What do other folks do in
similar situations?
Thanks.
-- Sarge
coding in c# and, well this group is a "csharp" group!
Background -- We encapsulate data access for an application
through a home-grown "DataEngine" object. This object follows
the singleton pattern. All is well and good, and everything
works just great for our desktop apps that hit the database
through the DataEngine.
Now, we've got to expose the DataEngine object to a web
server. Initially, I'm concerned. I don't do much (any)
web programming, but I've got a good feel for how it works.
My concern is that the DataEngine, being a singleton, will
be shared amongst all user sessions on the web server for
this site. This brings up 2 related major issues that I
have no clue on.
(1) Multi-threading. The DataEngine is not "thread-safe".
It assumes a single user. This was a good, valid assumption
based on the way we build our desktop apps.
(2) If I start locking things up to make it "thread-safe",
I believe I'm in a world of hurt as far as the DataEngine
becoming a bottleneck on the web server.
Do these concerns make sense? What do other folks do in
similar situations?
Thanks.
-- Sarge