[Rt-devel] DBIx::SearchBuilder and two database connections

Ruslan U. Zakirov cubic at acronis.ru
Fri Jul 23 05:54:53 EDT 2004


Tina Schade wrote:
> Hello folks,
> 
> I have the problem that my RT-Search doesn´t work correctly. The reason is 
> that I have createt a second local DBIx::Handle for my own database 
> connection. Now RT  searches for tickets in my database sometimes, but of 
> course it couldn´t find relation tickets in my database. But RT does it not 
> always. Sometimes I get results, when I click two or three time the reload 
> button!
> 
> 
> When I created the $CDB::Handle global, so RT works but searchs always in my 
> own database, although the Handle has different names and parameters.
How do you create this object? Some code?

> 
> I create the local $CDB::Handle connection in my own autohandler, which is in 
> path /rt3/share/html/Ticket/. I also tried to disconnect my database in 
> /rt3/share/html/autohandler, with no success.
> 
> It also doesn´t work to create my $handle = DBIx::SearchBuilder->new() in my 
> own autohandler.
It's wrong idea.  You shoul subclass DBIx::SearchBuilder and 
DBIx::SearchBuilder::Record or use RT's classes.

> 
> Now my question. Does I can use DBIx::SearchBuilder for my second database 
> connection? Does SearchBuilder bear up more than one database-connection in 
> one application, expecially RT?
> How can I realise two database-connection else, without creating  and closing 
> a connection in every file I need it?
It's not a problem of DBIx::SB as I think. IMHO you override something 
in RT namespace that break things in RT.

> 
> I use DBIx::SearchBuilder 1.00_06, a Postgres database, RT 3.0.11, with Apache 
> 2 and mod_perl2 on a SuSE 9.1 system.
> 
> Thanks for your help!
> 
> Grettings,
> Tina
> _______________________________________________
> Rt-devel mailing list
> Rt-devel at lists.bestpractical.com
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel



More information about the Rt-devel mailing list