question regarding Server_New and Database_New

Ruslan Zasukhin sunshine at public.kherson.ua
Thu Jul 8 09:22:58 CDT 2004


On 7/8/04 12:12 AM, "Chris Sheffield" <cm_sheffield at yahoo.com> wrote:

Hi Chris,

> These two functions create a server object and a
> database object, respectively.

> So once I've called
> these functions, and then made a call to
> Database_Open, when I close my database using
> Database_Close, does the connection to the server get
> released, or do I need to do something else?

Both this functions create 2 different objects.

Vserver object you need if you ADMIN and you want do some operations with
server. You need do

    Server_New
    OpenSession          << this will establish connect
    CloseSession         << close connect.

    destroy server object.
    Hmm. Not remember syntax for VXCMD now


Database object we use just to connect and open some db

    Database_New
    db.Open             << make connection
    db.Close
    delete db

Also you can use Vserver object to establish ONE connection
And later you create SEVERAL DB objects and use vserver to create them.

In this way you can have one connection, but open several dbs from Vserver.

    vsrv = server_new
        vsrv.OpenSession    // optional

    db1 = Database_New( vsrv )
    db2 = Database_New( vsrv )

    db1.Open    << if was OpenSession then use its connection
                << otherwise make connection self.
    db2.Open    << use the same connection


> Is it necessary to somehow destroy the database and server
> objects?

Yes of course. We always delete db object in VXCMD, right?


-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list