Forum OpenACS Development: Re: Invalid XML in XQL files

Collapse
Posted by Tom Jackson on

Could you create a new mega-file with all the queries, or maybe just a tcl file that runs a series of commands, avoiding parsing completely? Seems like the tcl file could check mtimes first and only parse new/changed stuff.

Collapse
Posted by John Sequeira on
I would like to propose an alternative to the megafile.  I know there's a python script somewhere that takes SQL out of the tcl files and into the XQL files.  I've prototyped a script that does the reverse - takes queries out of the XQL files and inlines them into the TCL script.  It then deletes/renames the XQL files so that they're not found and parsed on start-up - the query-dispatcher commands effectively become nop's.

The advantage of using this is that you don't take the XQL parsing hit on server start-up (which is substantial),  and you don't have to run through the query dispatcher code on each query or chew up more memory caching queries that are stored in bytecode-compiled tcl.

I initially did this so that I could get the openacs source code to play nice with nstcl,  but it seems like it could be useful to others.  I can definitely see why you'd want to have XQL files - they came in handy when I worked on porting the OpenACS kernel to MSSQL,  for instance.  However,  for people developing apps in OpenACS (as opposed to people developing Openacs) it seems as though the XQL abstraction just slows things down.

Using the script wouldn't require re-architecting OpenACS or even any kind of direct support,  but I just wanted to broach the idea before time was spent on upgrading the qd.