diff --git a/reference/cubrid/functions/cubrid-connect-with-url.xml b/reference/cubrid/functions/cubrid-connect-with-url.xml index 31847ad41e..314596a4e3 100644 --- a/reference/cubrid/functions/cubrid-connect-with-url.xml +++ b/reference/cubrid/functions/cubrid-connect-with-url.xml @@ -22,16 +22,23 @@ enabled in CUBRID, you must specify the connection information of the standby server, which is used for failover when failure occurs, in the url string argument of this function. If the user name and password is not - given, then the "PUBLIC" connection will be made by default. + given, then the "PUBLIC" connection will be made by default. If a second + call is made to cubrid_connect with the same + conn_url, and userid as an + existing connection, the existing connection will be returned unless you + pass. - <url> ::= cci:CUBRID:<host>:<db_name>:<db_user>:<db_password>:[?<properties>] + <url> ::= CUBRID:<host>:<db_name>:<db_user>:<db_password>:[?<properties>] <properties> ::= <property> [&<property>] <properties> ::= autocommit=<autocommit_mode> <alternative_hosts> ::= <standby_broker1_host>:<port> [,<standby_broker2_host>:<port>] <host> := HOSTNAME | IP_ADDR <time> := SECOND + + or <url> ::= cci:CUBRID:<host>:<db_name>:...... + host : A host name or IP address of the master database @@ -82,7 +89,7 @@ cubrid_connect + cubrid_pconnect + cubrid_pconnect_with_url cubrid_disconnect + cubrid_close diff --git a/reference/cubrid/functions/cubrid-connect.xml b/reference/cubrid/functions/cubrid-connect.xml index 81da9c5186..ef5c127610 100644 --- a/reference/cubrid/functions/cubrid-connect.xml +++ b/reference/cubrid/functions/cubrid-connect.xml @@ -22,7 +22,11 @@ environment for connecting to your server by using your server address, port number, database name, user name, and password. If the user name and password is not given, then the "PUBLIC" connection will be made by - default. + default. If a second call is made to cubrid_connect + with the same host, port, + dbname and userid as an + existing connection, the existing connection will be returned unless you + pass. @@ -128,8 +132,11 @@ CUBRID Charset: iso8859-1 &reftitle.seealso; + cubrid_pconnect cubrid_connect_with_url + cubrid_pconnect_with_url cubrid_disconnect + cubrid_close diff --git a/reference/cubrid/functions/cubrid-pconnect-with-url.xml b/reference/cubrid/functions/cubrid-pconnect-with-url.xml new file mode 100644 index 0000000000..449cf0f985 --- /dev/null +++ b/reference/cubrid/functions/cubrid-pconnect-with-url.xml @@ -0,0 +1,182 @@ + + + + + + cubrid_pconnect_with_url + Open a persistent connection to CUBRID server + + + + &reftitle.description; + + resourcecubrid_pconnect_with_url + stringconn_url + stringuserid + stringpasswd + + + Establishes a persistent connection to a CUBRID server. + + + cubrid_pconnect_with_url() acts very much like + cubrid_connect_with_url with two major differences. + + + First, when connecting, the function would first try to find a (persistent) + link that's already open with the same host, port, dbname and userid. If + one is found, an identifier for it will be returned instead of opening a + new connection. + + + Second, the connection to the SQL server will not be closed when the + execution of the script ends. Instead, the link will remain open for + future use (cubrid_close or + cubrid_disconnect will not close links established by + cubrid_pconnect_with_url). + + + This type of link is therefore called 'persistent'. + + + <url> ::= CUBRID:<host>:<db_name>:<db_user>:<db_password>:[?<properties>] + <properties> ::= <property> [&<property>] + <properties> ::= autocommit=<autocommit_mode> + <alternative_hosts> ::= <standby_broker1_host>:<port> [,<standby_broker2_host>:<port>] + <host> := HOSTNAME | IP_ADDR + <time> := SECOND + + + or <url> ::= cci:CUBRID:<host>:<db_name>:...... + + + + host : A host name or IP address of the master database + db_name : A name of the database + db_user : A name of the database user + db_password : A database user password + autocommit : The database connection auto-commit mode + alhosts: Specifies the broker information of the standby server, which is used for failover when it is impossible to connect to the active server. You can specify multiple brokers for failover, and the connection to the brokers is attempted in the order listed in alhosts + rctime : An interval between the attempts to connect to the active broker in which failure occurred. After a failure occurs, the system connects to the broker specified by althosts (failover), terminates the transaction, and then attempts to connect to the active broker of the master database at every rctime. The default value is 600 seconds. + + + + + + &reftitle.parameters; + + + + conn_url + A character string that contains server connection information. + + + userid + User name for the database. + + + passwd + User password. + + + + + + + &reftitle.returnvalues; + + Connection identifier, when process is successful. + + + &false;, when process is unsuccessful. + + + + + &reftitle.examples; + + <function>cubrid_connect_with_url</function> url without properties example + + +]]> + + + + + <function>cubrid_connect_with_url</function> url with properties example + + +]]> + + + + + + &reftitle.seealso; + + + cubrid_connect + cubrid_pconnect + cubrid_pconnect_with_url + cubrid_disconnect + cubrid_close + + + + + + + diff --git a/reference/cubrid/functions/cubrid-pconnect.xml b/reference/cubrid/functions/cubrid-pconnect.xml new file mode 100644 index 0000000000..4eda49397f --- /dev/null +++ b/reference/cubrid/functions/cubrid-pconnect.xml @@ -0,0 +1,177 @@ + + + + + + cubrid_pconnect + Open a persistent connection to a CUBRID server + + + + &reftitle.description; + + resourcecubrid_pconnect + stringhost + intport + stringdbname + stringuserid + stringpasswd + + + Establishes a persistent connection to a CUBRID server. + + + cubrid_pconnect() acts very much like + cubrid_connect with two major differences. + + + First, when connecting, the function would first try to find a (persistent) + link that's already open with the same host, port, dbname and userid. If + one is found, an identifier for it will be returned instead of opening a + new connection. + + + Second, the connection to the SQL server will not be closed when the + execution of the script ends. Instead, the link will remain open for + future use (cubrid_close or + cubrid_disconnect will not close links established by + cubrid_pconnect). + + + This type of link is therefore called 'persistent'. + + + + + &reftitle.parameters; + + + + host + Host name or IP address of CUBRID CAS server. + + + port + Port number of CUBRID CAS server (BROKER_PORT configured in $CUBRID/conf/cubrid_broker.conf). + + + dbname + Name of database. + + + userid + User name for the database. + + + passwd + User password. + + + + + + + &reftitle.returnvalues; + + Connection identifier, when process is successful. + + + &false;, when process is unsuccessful. + + + + + &reftitle.examples; + + <function>cubrid_connect</function> example + + +]]> + + &example.outputs; + + + + + + + + &reftitle.seealso; + + + cubrid_pconnect + cubrid_connect_with_url + cubrid_pconnect_with_url + cubrid_disconnect + cubrid_close + + + + + + +