Board index » delphi » MTS Dis/EnableCommit - using keeping objects alive?!?

MTS Dis/EnableCommit - using keeping objects alive?!?

As a newbie to MTS I'm hoping somebody can provide me with some advice on
the following issues...

I'm designing a set of D5 COM services to work with an ASP based web front
end. My draft class design is something like...

            System
                    |--- Session
                               |--- Business Objects

Each user first connects first to the COM server 'system' object and uses
one of its methods return a 'session' object.  Each user has a session
object - it includes a login method - and is used much like a passport to
identify an individual user.  The session object allows a user access to
underlying business objects.

Here are my questions...

a). Keeping the user's session object alive.

With simple ASP all objects are created and then disposed of at the end of
the ASP request. Ideally I'd want to keep the 'Session' object around until
such time that the user terminates the web session. How best to achieve
this?

Should I be looking at using the MTS 'EnableCommit/DisableCommit'  concepts?
Or is there a better way? Like having the system object maintain a list of
session objects?    (I suppose here I'm trying to emulate the JSP 'scope'
object life cycle management concept.)

b). Keeping a singleton system object

I really only want a singleton instance of the System object to be created
and kept alive whilst the ASP app is running.  How do I this? Using MTS
'EnableCommit/DisableCommit' ?

Thanks,

            ..... davout

 

Re:MTS Dis/EnableCommit - using keeping objects alive?!?


Quote
"davout" <dav...@dial.pipex.com> wrote in message news:3af5792d_1@dnews...
> a). Keeping the user's session object alive.

> With simple ASP all objects are created and then disposed of at the end of
> the ASP request. Ideally I'd want to keep the 'Session' object around
until
> such time that the user terminates the web session. How best to achieve
> this?

> Should I be looking at using the MTS 'EnableCommit/DisableCommit'
concepts?
> Or is there a better way? Like having the system object maintain a list of
> session objects?    (I suppose here I'm trying to emulate the JSP 'scope'
> object life cycle management concept.)

If you want to keep a server-side per-session instance running around, one
way is to use the ASP-provided Session object. So in ASP, you can say:

set Session ("MySessionObj") = SomeObject

And then later on:

set MySessionObject := Session ("MySessionObj")
MySessionObject.Foo

Quote
> b). Keeping a singleton system object

> I really only want a singleton instance of the System object to be created
> and kept alive whilst the ASP app is running.  How do I this? Using MTS
> 'EnableCommit/DisableCommit' ?

The ASP session object mentioned above should allow you to do this. If you
want a singleton for all ASP sessions, one way is to use the ASP-provided
Application object.

--
have fun
Binh Ly
www.techvanguards.com

Other Threads