Ben Forta

Blog

September 18, 2001

Lock IsDefined() Checks

Everyone knows that access to shared scopes (like APPLICATION) must be locked, both read access (locked with READONLY) and write access (locked with EXCLUSIVE). But many don't realize that an IsDefined() test is a read and must be locked too. So, if you have code that looks like make sure to lock...

September 17, 2001

Creating a Spider

Want to spider a site, indexing all pages and links within it? Using the new Verity engine included with CF5 you can. In the Verity BIN directory (under CFUSIONVerity) you'll find a utility named vspider. Execute it, specify the URL and other parameters, and it'll do the rest for you. You'll be...

September 16, 2001

Passing Queries or Structure to UDF's

Variables passed to User Defined Functions (UDF's) are passed by value - a copy is made and the data within the UDF is a copy, not the original, and so any changes made within the UDF will not affect the original data. However, this is not the case with queries or structures - these are passed by...

September 15, 2001

Make Sure Those Variables Are Local

Within a User Defined Function (UDF) code may access variables in any scope as well as local variables (local to the function itself). Any temporary variables, counters, loop condition variables and any other variables used within a UDF should be defined at the top of the function using the VAR...

September 14, 2001

Compilation Without Execution

The first time any CFM file is processed it must be compiled into pcode, and if there is sufficient space available in the template cache that pcode may be cached to prevent repeated unnecessary compilation (which could take longer than actual code processing). The undocumented tag can be used to...

September 13, 2001

Using Verity K2 Collections

If you are using Verity's new K2 full text searching engine you may use one of several new functions available in ColdFusion 5: GetK2ServerCollections() returns a comma delimited list of collections, GetK2ServerDocCount() returns the total number of available documents, GetK2ServerDocLimit()...

September 12, 2001

Temporarily Disabling Data Source Access

Individual data sources may be temporarily disabled using the ColdFusion Administrator. You may also perform this programmatically using the undocumented CFusion_Disable_DBConnections() function. This function takes two parameter, the first is the name of the data source, and the second is a TRUE...

September 11, 2001

Forcing the Closing of Database Connections

ColdFusion pools database connections to improve performance. Data source connections may be dropped as needed using the ColdFusion Administrator (this process also unlocks any locked files, for example, Microsoft Access MDB files), but you can also do this programmatically using the undocumented...

September 10, 2001

Verifying Data Source Existence

Want to check that a data source has been defined and is useable? You could just try to use it and catch any generated errors. Or you could use the undocumented CF_IsColdFusionDataSource() function which takes the name of a data source as a parameter (within quotes) and returns TRUE if it is...

September 9, 2001

Verifying SMTP Server Accessibility

Want to check that an SMTP server is accessible before using it to send mail? Use the undocumented CFusion_VerifyMail() function which takes three parameters - the server to be checked (IP address or DNS name), the port, and a timeout interval. CFusion_VerifyMail() returns a string that may be...

Page 453 of 489 (4890 posts)