4D v16

Closing a connection

Home

 
4D v16
Closing a connection

Closing a connection  


 

 

Here we use the OCIHandleFree command to free the handles, and then close the session. When handles are structured hierarchically, closing the parent handle also closes its related handles.

The code below is used to disconnect from the Oracle server. We could also use the OCILogoff command instead.

OCISessionEnd deletes the session.
OCIServerDetach deletes the path to the Oracle server.

After this, we can free the handles one by one, or just free the environment handles, which in turn will release the other handles.

Source code for OCI_DISCONNECT project method:

  //Method: DISCONNECT
  //Method call: DISCONNECT
  //Use: disconnects the currently-connected user
 
 C_LONGINT($status//return of OCI commands
 
 $status:=OCISessionEnd(svchp;errhp;authp) //deletion of user session
 $status:=OCIServerDetach(srvhp;errhp) //deletion of access to data source
 $status:=OCIHandleFree(envhp) //frees the environment handle
  //which in turn frees up all the other handles

 
EIGENSCHAFTEN 

Produkt: 4D
Thema: Examples of use

 
GESCHICHTE 

 
ARTIKELVERWENDUNG

4D for OCI ( 4D v16)