Thread: TCL and MySQL
View Single Post
Old 07-05-2003, 07:16 AM  
darkone
Disabled
 
darkone's Avatar
 
Join Date: Dec 2001
Posts: 2,230
Default

Btw. it's possible to have persistent connection to mysql server using itcl:

- Create initialization routine, that establishes connection to server. Store connection to UNIQUE GLOBAL variable (a good name for variable is ie. dupescript_mysql, where as mysql is a bad name)
- Call initialization procedure from init.itcl (init.itcl does not exist in standard installation: Create it under scripts subdir)

** Note that you will have X persistent connections to mysqld, where X is equal to amount of TCL intepreters defined in ioftpd's config **

You can also cache all procedures of your script:

- Split your script into two files, where first file contains only procedures (library) and second contains calls to procedures
- Load library file from init.itcl

by splitting it into two files (first file contains procedures and second contains only calls to those procedures)
darkone is offline