Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File errors? 1

Status
Not open for further replies.

webmigit

Programmer
Joined
Aug 3, 2001
Messages
2,027
Location
US
Files run faster than queries.. when the data is stored from the query on a routine basis.. but I've never really used files before so I want to make sure its not gonna error out on me.. has anyone used text files heavily in their application.. both on a user by user basis and one set of files that every user can access? What are the results.. where are the weak points? what can be done to catch them before they occur.. Any help is appreciated!!

Thanks,
Tony Hicks
 
Hey Tony,

I've used them in various places and never had trouble. You just have to make sure the file exists and handle any "file not found" errors but I don't think you'll have to worry with any performance issues on them. The only thing I would watch is the file size. Since CF opens the entire file and puts it in a variable, you just need to make sure the file size isn't so large as to cause a problem with multiple instances opening the same file into memory. I don't know if CF reads the entire file into memory or if it does intelligent buffering but in any case, I think you'll want to keep the file size reasonable in relation to the server's memory and the hits it'll be taking.

Good luck,
GJ
 
The thing is, you do have to worry about locking the files, which means no two processes can be using a single file at the same time. That makes me wonder just how much of a performance benefit you're going to get.

Also, if you just lock the file, read it into memory and then close the lock, you'd better not open it back up to write to it later, or you'll have some serious concurrency problems. Basically, I'm just telling you have to re-invent solutions for all the problems that a database solves.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top