Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Thanks in advance, PB COM objects and MTS

4 posts in General Discussion (old) Last posting was on 2000-03-09 17:01:37.0Z
Chris mcnally Posted on 2000-03-09 16:15:59.0Z
Newsgroups: sybase.public.easerver
Date: Thu, 09 Mar 2000 11:15:59 -0500
From: Chris mcnally <chrismcnally@bigfoot.com>
X-Mailer: Mozilla 4.7 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Thanks in advance, PB COM objects and MTS
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 45
NNTP-Posting-Host: hboc.com 139.177.224.128
Message-ID: <347_38C7CE3E.282676BC@bigfoot.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26793
Article PK: 154441

Could someone please take a moment to answer these questions for me or
point me in the right direction documentation-wise? The MS docs and
ASP/MTS books all refer to Visual Basic components, and the powerbuilder
docs I'm using are a little thin :-)

I'm using PB 7 to build COM components that run in MTS. I'm using ASP
to call them.

I am trying to build stateless components, but at the same time I'd like
to to some work only once during the lifetime of the component (like
lookup database info in the registry).

My questions are related to the constructor, activate, deactivate and
destructor events. And the use of set complete and setabort.

what happens when my component is created the first time, obviously the
constructor and activate events are triggered before the first method
call. what happens when I call setcomplete in the method? are both the
deactivate and desstructor events triggered?

How does this component sharing work? If several users are using a
single instance of a component, then when does the activate and
deactivate events get triggered? Are they triggered again for each
method call made?

I would like to take advantage of instance variables if I can do that,
without forcing the component to be stateful. for example, all users
connect to the same database with the same username and password. ON
the constructor event I go to the registry for that info. If I save it
in instance variables is this OK?

I guess I just need a good, clear explanation of how MTS supports 'just
in time activation' and some kind of context thing, which I don't know
what it's called.

The Jaguar book by Barlotta was so great. I would love a similar book
for MTS.

Chris Mcnally ( chris.mcnally@hboc.com)


Andreas S. Brunvoll Posted on 2000-03-09 17:01:37.0Z
Newsgroups: sybase.public.easerver
Date: Thu, 09 Mar 2000 18:01:37 +0100
From: "Andreas S. Brunvoll" <abr@avenir.no>
X-Mailer: Mozilla 4.7 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Thanks in advance, PB COM objects and MTS
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 68
NNTP-Posting-Host: 139.108.179.131
Message-ID: <347_38C7D8F0.878B7767@avenir.no>
References: <347_38C7CE3E.282676BC@bigfoot.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26783
Article PK: 157760

I can just answer some of your questions, and the answer is  more based upon experience than theoretical study.
1. When calling setComplete or setAbort to a statful MTS-object the object is deactivated an all instance variables of that object is destroyed. All subsequent calls to the object will return something like "automation error".
2. Stateless object can be reused after calling setAbort/setComplete.
3. You should not keep database logon-information in instance variables, but use the "shared property"-feature of the MTS to avoid the problems above.

Regards

Andreas

Chris mcnally wrote:

Could someone please take  a moment to answer these questions for me or
point me in the right direction documentation-wise?  The MS docs and
ASP/MTS books all refer to Visual Basic components, and the powerbuilder
docs I'm using are a little thin :-)

I'm using PB 7 to build COM components that run in MTS.  I'm using ASP
to call them.

I am trying to build stateless components, but at the same time I'd like
to to some work only once during the lifetime of the component (like
lookup database info in the registry).

My questions are related to the  constructor, activate, deactivate and
destructor events.  And the use of set complete and setabort.

what happens when my component is created the first time, obviously the
constructor and activate events are triggered before the first method
call.  what happens when I call setcomplete in the method?  are both the
deactivate and desstructor events triggered?

How does this component sharing work?  If several users are using a
single instance of a component, then when does the activate and
deactivate events get triggered?  Are they triggered again for each
method call made?

I would like to take advantage of instance variables if I can do that,
without forcing the component to be stateful.  for example, all users
connect to the same database with the same username and password.  ON
the constructor event I go to the registry for that info.  If I save it
in instance variables is this OK?

I guess I just need a good, clear explanation of how MTS supports 'just
in time activation' and some kind of context thing, which I don't know
what it's called.

The Jaguar book by Barlotta was so great.  I would love a similar book
for MTS.

Chris Mcnally ( chris.mcnally@hboc.com)


Philip Salgannik Posted on 2000-03-09 16:51:38.0Z
Newsgroups: sybase.public.easerver
From: "Philip Salgannik" <psalgannik@softrax.com>
Subject: Re: Thanks in advance, PB COM objects and MTS
Date: Thu, 9 Mar 2000 11:51:38 -0500
Lines: 51
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
NNTP-Posting-Host: mail1.softraxcorp.com 137.103.200.2
Message-ID: <347_if2Pwfei$GA.201@forums.sybase.com>
References: <347_38C7CE3E.282676BC@bigfoot.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26785
Article PK: 157761

Here is a little bit
http://home.earthlink.net/~regansizer/powerbuilder/articles/intro2com/index.
htm

--
pbm_thisusuallydoesnothelp :-))

"Chris mcnally" <chrismcnally@bigfoot.com> wrote in message
news:38C7CE3E.282676BC@bigfoot.com...
> Could someone please take a moment to answer these questions for me or
> point me in the right direction documentation-wise? The MS docs and
> ASP/MTS books all refer to Visual Basic components, and the powerbuilder
> docs I'm using are a little thin :-)
>
> I'm using PB 7 to build COM components that run in MTS. I'm using ASP
> to call them.
>
> I am trying to build stateless components, but at the same time I'd like
> to to some work only once during the lifetime of the component (like
> lookup database info in the registry).
>
> My questions are related to the constructor, activate, deactivate and
> destructor events. And the use of set complete and setabort.
>
> what happens when my component is created the first time, obviously the
> constructor and activate events are triggered before the first method
> call. what happens when I call setcomplete in the method? are both the
> deactivate and desstructor events triggered?
>
> How does this component sharing work? If several users are using a
> single instance of a component, then when does the activate and
> deactivate events get triggered? Are they triggered again for each
> method call made?
>
> I would like to take advantage of instance variables if I can do that,
> without forcing the component to be stateful. for example, all users
> connect to the same database with the same username and password. ON
> the constructor event I go to the registry for that info. If I save it
> in instance variables is this OK?
>
> I guess I just need a good, clear explanation of how MTS supports 'just
> in time activation' and some kind of context thing, which I don't know
> what it's called.
>
> The Jaguar book by Barlotta was so great. I would love a similar book
> for MTS.
>
> Chris Mcnally ( chris.mcnally@hboc.com)
>


Jay S. Posted on 2000-03-09 16:26:24.0Z
Newsgroups: sybase.public.easerver
From: "Jay S." <ash477@hotmail.com>
Subject: Re: Thanks in advance, PB COM objects and MTS
Date: Thu, 9 Mar 2000 11:26:24 -0500
Lines: 38
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
NNTP-Posting-Host: cc414260-a.etntwn1.nj.home.com 24.3.205.187
Message-ID: <347_u9jroWei$GA.74@forums.sybase.com>
References: <347_38C7CE3E.282676BC@bigfoot.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26789
Article PK: 157765

I second everything Chris is asking for !!!!!!!!!!! Especially with COM+
and Windows2000, I'd like to know how to make the most scaleable system
possible with the html dw component.

> I am trying to build stateless components, but at the same time I'd like
> to to some work only once during the lifetime of the component (like
> lookup database info in the registry).
>
> My questions are related to the constructor, activate, deactivate and
> destructor events. And the use of set complete and setabort.
>
> what happens when my component is created the first time, obviously the
> constructor and activate events are triggered before the first method
> call. what happens when I call setcomplete in the method? are both the
> deactivate and desstructor events triggered?
>
> How does this component sharing work? If several users are using a
> single instance of a component, then when does the activate and
> deactivate events get triggered? Are they triggered again for each
> method call made?
>
> I would like to take advantage of instance variables if I can do that,
> without forcing the component to be stateful. for example, all users
> connect to the same database with the same username and password. ON
> the constructor event I go to the registry for that info. If I save it
> in instance variables is this OK?
>
> I guess I just need a good, clear explanation of how MTS supports 'just
> in time activation' and some kind of context thing, which I don't know
> what it's called.
>
> The Jaguar book by Barlotta was so great. I would love a similar book
> for MTS.
>
> Chris Mcnally ( chris.mcnally@hboc.com)
>