[Catalyst] CDBI model make 2 mysql connections

Maxim Nechaev nechaev at technodesign.ru
Fri Nov 25 05:19:16 CET 2005


I make CDBI model:

xeim at slack:~/MyApp/script$ ./myapp_create.pl model CDBI CDBI dbi:mysql:database=test root
 exists "/home/xeim/MyApp/script/../lib/MyApp/Model"
 exists "/home/xeim/MyApp/script/../t"
created "/home/xeim/MyApp/script/../lib/MyApp/Model/CDBI.pm"
created "/home/xeim/MyApp/script/../lib/MyApp/Model/CDBI"
created "/home/xeim/MyApp/script/../lib/MyApp/Model/CDBI/Session.pm"
created "/home/xeim/MyApp/script/../lib/MyApp/Model/CDBI/User.pm"
 exists "/home/xeim/MyApp/script/../t"
created "/home/xeim/MyApp/script/../t/model_CDBI-Session.t"
 exists "/home/xeim/MyApp/script/../t"
created "/home/xeim/MyApp/script/../t/model_CDBI-User.t"

Then i start server:
xeim at slack:~/MyApp/script$ ./myapp_server.pl
...

And then in in mysql query log added:
Time                 Id Command    Argument
...
051125 14:13:40      83 Connect     root at localhost on test
                     83 Query       set autocommit=1
                     83 Query       SHOW TABLES
                     83 Quit
                     84 Connect     root at localhost on test
                     84 Query       set autocommit=1
                     84 Query       DESCRIBE Session
                     84 Query       set autocommit=1
                     84 Query       DESCRIBE User
                     84 Query       SHOW TABLE STATUS FROM test LIKE 'Session'
                     84 Query       SHOW TABLE STATUS FROM test LIKE 'User'


Look like Catalyst::Model::CDBI make two database connections during
initializing. I'am right? Why so happen?


-- 
Maxim Nechaev




More information about the Catalyst mailing list