[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference orarep::nomahs::dbstars

Title:DBSTARS Conference
Moderator:BROKE::BASTINE
Created:Wed Feb 02 1994
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:791
Total number of notes:1521

764.0. "Remote links grow when using dbi & trans reusa" by BROKE::BITHER () Wed Apr 16 1997 10:52

     <<< NOMAHS::DISK$NOMAHS1:[NOTES$LIBRARY]DBINTEGRATOR_PUBLIC.NOTE;2 >>>
                      -< DB Integrator Public Conference >-
================================================================================
Note 1153.0               Remote links get out of hand.                  1 reply
10245::COBROWN "Colin from Danmark"                  22 lines  15-APR-1997 10:50
--------------------------------------------------------------------------------
    I'll start with this question here, but could be it is one for SQS.
    
    Rdb 7.0-01, DBI 7.0, SQS 7.0 all on AXP under VMS 6.2.
    
    Service defined in SQS with reuse TRANSACTION.
    Service attaches to a DBI database with links to remote databases.
    
    User attaches to DB via SQS and accesses a table on the remote database
    and all is fine.
    User logs off. All is fine.
    
    Except the service is still attached to the remote database.
    
    More users and more access to remote databases and we now have lots of
    links open.
    
    Is there anyway that the service can disconnect the remote attaches
    when the user who was using them drops their connection to the service?
    
    Without loosing the benifits of transaction reusable services?
    
    Colin - Danmark
================================================================================
Note 1153.1               Remote links get out of hand.                   1 of 1
BROKE::BITHER                                        30 lines  16-APR-1997 09:51
                             -< Expected behavior >-
--------------------------------------------------------------------------------
Hi Colin,

I believe this is expected behavior.  In interactive SQL, when a process
attaches to DBI and selects from tables that activate links to underlying
databases those links remain active for the life of the attach.  There
is no way that I know of to deactivate the links without logging out of 
dbi and back into dbi.  You've probably seen this if you've ever tried to 
drop a link that has been activated.  You can't until you logout and log 
back in.

Because you are using a transaction resusable service, processes are using the
same service and consequently are accessing the database in the last state it
was left in by a previous process (after a commit or rollback.) If the previous
process selected from a table from a remote udb, that link will have been
activated.  After a commit/rollback, the session is ready for another user
process but the link will still be active because the service has not logged
out of and back into dbi.  Commit/rollback will not deactivate links, only
logging out and back in will do this.

I don't see how you can do this except by using a database class
service that is non transaction reusable.  That way each user process
that uses the service will be preattached to the database but no links
will have been activated because each process will be first-time
user of the session.

However, the upside of this is that performance should be better in that the
overhead of activating the links does not need to be incurred by any other
processes for the life of the service.

Diane
T.RTitleUserPersonal
Name
DateLines
764.1Final - sent to Mem 5/20/97BROKE::BITHERTue May 20 1997 15:5794
From:	BROKE::BITHER       "Please reply to [email protected]" 20-MAY-1997 14:42:49.44
To:	M5::MEMORMAN
CC:	BITHER
Subj:	New STARS article

TITLE:      DBI Remote Links Using Database Services


PRODUCT:    Distributed Option 7.0

RELATED
PRODUCTS:   SQL/Services 7.0
            Rdb 7.*

OP/SYS:     OpenVMS VAX, OpenVMS AXP

SOURCE:     Oracle Worldwide Customer Support


PROBLEM:

Remote link connections (remote database attaches) in Distributed Option (DBI)
do not disconnect when exiting from a SQL/Services database service.


SCENARIO:

A client connects to a SQL/Services database service which is preattached to a
DBI database.  The DBI database has links to multiple  underlying remote
databases.  The user accesses a table in DBI from one of the remote underlying
databases and disconnects.  Consequently, an active remote connection still 
exists from the DBI server to the remote database.  
    
As more and more users access tables from different underlying remote 
databases via DBI and database services, it is possible to activate several
remote connections and have them remain active after users disconnect
from the server.  For each different remote link that has been activated 
per each database class service an active remote link will remain.


QUESTION:

Is there anyway that remote database attaches can be disconnected when the
user disconnects from the service without losing the benefits of transaction
reusable services?
    

ANSWER:

This is expected behavior for both transaction reusable database services and
nontransaction reusable database services.  In interactive SQL, when a process
attaches to DBI and selects from tables that activate links to underlying
databases those links remain active for the life of the attach.  The only way
to deactivate these links is to log out and back into DBI.

When using a transaction reusable database service, processes are using the
same process stream to a particular service and consequently are accessing the
database in the last state it was left in by a previous process (after a commit
or rollback.) If the previous process selected from a table from a remote
underlying database, that link will have been activated.  After a
commit/rollback, the session is ready for another user process but the link
will still be active because the service has not logged out of and back into
DBI.  This is the nature of a database service. That is, a disconnect from the
database is not done in order to avoid the overhead of attach processing for
other database service users. Commit/rollback will not deactivate links, only
logging out and back in will  do this.

When using a nontransaction reusable database service, processes cannot share
a single process accessing the database service (as in the case of
nontransactional services) but they can reuse a process that accesses the
database service.  When they do this, that process is preattached to the
database and if any remote links were activated by a previous process using
that process stream those links will still be  still be active when the new 
process logs on because by nature the database service  will not have 
disconnected from the database (the only way to deactivate  the links.)

Advantage:
----------
Performance should be better in that once the links are activated (attaches to
the underlying databases are made) the overhead of these database attaches
does not need to be incurred again by any  other processes for the life of the
connection to the service.

However, if it is necessary for your system to minimize the number of active
remote links the solution would be to use a generic service.  That way
each time a user process disconnects from the service the attachment to
the database is also disconnected and this will inactivate the links.


\
\ CONTRIBUTORS:
\
\       Technical: Diane Bither