Hi,

  I'm trying to learn how to use DBIx::Database object. My code starts
with something like this

$db = DBIx::Database->new({
        '!DataSource' => "DBI:Pg:dbname=phl",
        '!Username' => 'postgres',
        '!DBIAttr' => { RaiseError => 1, AutoCommit => 0 },
        '!DoOnConnect' => [ qq(SET CLIENT_ENCODING TO 'win1250'), qq(SET
DATESTYLE TO 'german') ]
});

*hotels = DBIx::Recordset->Setup({
        '!DataSource' => $db,
        '!Table' => 'hotels,descriptions',
        '!TabRelation' => 'hotels.id = descriptions.id',
});

*tours = DBIx::Recordset->Setup({
        '!DataSource' => $db,
        '!Table' => 'tours,descriptions',
        '!TabRelation' => 'tours.id = descriptions.id',
});

*packages = DBIx::Recordset->Search({
        '!DataSource' => $db,
        '!Table' => 'packages,descriptions',
        '!TabRelation' => 'packages.id = descriptions.id',
});

*cars = DBIx::Recordset->Search({
        '!DataSource' => $db,
        '!Table' => 'cars,descriptions',
        '!TabRelation' => 'cars.id = descriptions.id',
});


I hoped $db would create the connection and then the other objects would
use it but this is probably not the case because I see to many posgres
backend starting on each request. How can I make $db create object AND
connect? Thanks.

- Robert

PS Gerald, did you receive my yestarday's mail (preliminary "itarate all
sessions" patch)? No hurry, just checking it's not lost somewhere.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to