Subject | Re: Firebird1.5, ADODB & PHP Sessions |
---|---|
Author | robert_hollay |
Post date | 2004-06-01T04:50:16Z |
Hi,
Thanks for responses. As I said before, I'm using ADODB, not
php ibase functions directly (with rare exceptions). My
"connect.php" is something like:
<?php
require_once('adodb/adodb.inc.php');
require_once('adodb/session/adodb-session.php');
$DBHOST = 'myhost';
$DBPATH = 'c:\data\fb15\mydir\mydb.fdb;
$DBDRIVER = 'firebird';
$ADODB_SESSION_DRIVER = $DBDRIVER;
$ADODB_SESSION_CONNECT = $DBHOST;
$ADODB_SESSION_USER = 'session';
$ADODB_SESSION_PWD = 'session';
$ADODB_SESS_LIFE = 4 * 3600;
$ADODB_SESSION_DB = $DBPATH;
$ADODB_SESSION_TBL = 'SESSIONS';
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
adodb_sess_open(false,false,false);
session_start();
$db = ADONewConnection($DBDRIVER);
$db->dialect = 3;
$db->Connect($DBHOST.':'.$DBPATH, $_SESSION['login'], $_SESSION
['password']);
?>
Session login and password I'm gathering in the first page opened.
AFAIK, $db->Connect() maps to ibase_connect, not ibase_pconnect.
One more question: if the users close they Web browsers immediately,
what about the FB server processes (Classic Server)? Are they
running on? When they are expected to terminate?
TIA, Robert
--- In firebird-php@yahoogroups.com, "Alan McDonald" <alan@m...>
wrote:
Thanks for responses. As I said before, I'm using ADODB, not
php ibase functions directly (with rare exceptions). My
"connect.php" is something like:
<?php
require_once('adodb/adodb.inc.php');
require_once('adodb/session/adodb-session.php');
$DBHOST = 'myhost';
$DBPATH = 'c:\data\fb15\mydir\mydb.fdb;
$DBDRIVER = 'firebird';
$ADODB_SESSION_DRIVER = $DBDRIVER;
$ADODB_SESSION_CONNECT = $DBHOST;
$ADODB_SESSION_USER = 'session';
$ADODB_SESSION_PWD = 'session';
$ADODB_SESS_LIFE = 4 * 3600;
$ADODB_SESSION_DB = $DBPATH;
$ADODB_SESSION_TBL = 'SESSIONS';
$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
adodb_sess_open(false,false,false);
session_start();
$db = ADONewConnection($DBDRIVER);
$db->dialect = 3;
$db->Connect($DBHOST.':'.$DBPATH, $_SESSION['login'], $_SESSION
['password']);
?>
Session login and password I'm gathering in the first page opened.
AFAIK, $db->Connect() maps to ibase_connect, not ibase_pconnect.
One more question: if the users close they Web browsers immediately,
what about the FB server processes (Classic Server)? Are they
running on? When they are expected to terminate?
TIA, Robert
--- In firebird-php@yahoogroups.com, "Alan McDonald" <alan@m...>
wrote:
>opened
>
> What method do you use for connecting to FB? ibase_connect or
> ibase_pconnect? Because the ibase_pconnect leaves the connection
> between 2 call and because of this the FB server process won't bemaintains
> terminated even if it is classic server.
>
> Alex
>
> It has been said here before that pconnect, although by theory it
> a connection pool, has a habit of not using existing connectionsafter they
> have recently been dropped, but rather establishing a newconnection. As a
> result, the number of open connections climbs - you have to keepyour eye on
> it apparently. ibase_connect will be slightly slower theoreticallybut I
> haven;t noticed any difference, and it does not have the statedproblem of
> pconnect.
> Alan