[thelist] CF/Sybase Tip

Joshua Olson joshua at alphashop.net
Thu Sep 13 09:45:46 CDT 2001


<tip type="Cold Fusion and Sybase ASE">
Cold Fusion and Adaptive Server Enterprise have a troubled relationship.
ASE logs every insert, update, delete and insert to the log file to satiate
it's needs for records keeping for transaction control.  When the log fills
up, Cold Fusion retries a failed operation a few times and crashes, denying
any additional queries against the same database.  Since it may not be
possible to turn off the logging in some cases, you must know how to clear
the transaction log.

Try putting this into the Application.cfm file:

<cfif RandRange(1, 500) IS "3">
  <cfquery name="dump_logs"
            datasource="#request.datasource#"
            dbtype="#request.dbtype#">
    USE master
    DUMP TRANSACTION #request.datasource# WITH no_log
    CHECKPOINT
    USE #request.datasource#
    CHECKPOINT
  </cfquery>
</cfif>

It does not execute particularly fast (hence the cfif bit), but it will dump
the entire transaction log for a database about every 500 page hits ensuring
that the log stays nearly empty.

Note: This has not been exhaustively tested in a multi-threaded environment.
</tip>





More information about the thelist mailing list