[AccessD] Using Global Connctions

Drew Wutka DWUTKA at marlow.com
Thu Mar 13 21:10:00 CST 2003


I have never used statis functions.  If I want my globals to 'default' to a
particular value, I make a Class, and make a global instance of the class.

Drew

-----Original Message-----
From: Arthur Fuller
To: accessd at databaseadvisors.com
Sent: 3/13/03 7:15 AM
Subject: RE: [AccessD] Using Global Connctions

In case JC is too busy, I'll step up. I never use globals. For
equivalent
functionality I always use static functions.

Arthur

-----Original Message-----
From: accessd-admin at databaseadvisors.com
[mailto:accessd-admin at databaseadvisors.com] On Behalf Of Marcus, Scott
(GEAE, RHI Consulting)
Sent: March 12, 2003 1:46 PM
To: 'accessd at databaseadvisors.com'
Subject: RE: [AccessD] Using Global Connctions


Drew,

I miss the debate we had last time on globals. Fortunately I'm not Borg
so
resistance is not futile. I wonder if JC is paying attention.

Scott

-----Original Message-----
From: Drew Wutka [mailto:DWUTKA at marlow.com]
Sent: Wednesday, March 12, 2003 1:31 PM
To: 'accessd at databaseadvisors.com'
Subject: RE: [AccessD] Using Global Connctions


Love Globals.
They are just as reliable as any other code.
If someone did, it would be me! <VBG>
Sometimes.
Yes, all the time.  I 'hit and release' my ADO Connections all the time,
especially when on a LAN.  In fact, the first vergence from that
practice
just happened last night.  I am working on a web interface to a Contact
Request database.  The database is on our Internet Web Server, and the
Web
interface is on our Intranet Web Server.  Creating the connection
through
the network (from server to server) takes about half a second to a
second
(didn't really time it...).  I have multiple classes working on each
page,
each of which require db interaction.  Opening and killing the
connection
creates unacceptable delays (3 to 4 seconds per page load...I know
that's
not too bad, but in comparison to almost instantaneous pulls with the
method
I am using now, there is a big difference).  So what I did, was take a
major
'class', which represents information about the person logged in (it's
used
in every page), and I load an instance of that class, if it hasn't been
loaded.  If it has been loaded, I pull the class from a Session
variable,
which has already been loaded.  That class keeps the connection open
while
the class is live, so I can then pass the connection object to other
classes, keeping it open the entire time.

With that method, the first page on the site (whatever page is hit)
takes a
few moments to load, but from that point on, the site runs as fast as
the
user can click.  I left the default timeout of 10 minutes on the session
object, so as long as the user doesn't wait more then 10 minutes before
doing something on the site, they won't experience the temporarily delay
in
the  main class loading.

Drew

-----Original Message-----
From: Mark L. Breen [mailto:subs at solution-providers.ie]
Sent: Wednesday, March 12, 2003 3:35 AM
To: accessd at databaseadvisors.com
Subject: [AccessD] Using Global Connctions


Hello All,

As a follow up to Susan Harkins discussion on the command object,

How do you guys use a global connection in your apps

What I have been doing is initialising gccnn when I load the app.  It is
G
lobal C onstant cnn.

I then use this Global variable for every ADO section of code.

Do you hate global variables?
do you think that they are unreliable?
do you think that someone is going to come in the middle of the night
and
wipe it out? Do you use a class or property pass it around instead? In a
fat
client, LAN, does anyone initialise it and close it each time? (I
presume
not)

Just intested in your feedback

Thanks



_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list