######################################################################## from SkunkWeb import Configuration import MySQL from SkunkExcept import SkunkStandardError from requestHandler.requestHandler import CleanupRequest Configuration.mergeDefaults(MySQLConnectParams={}, MySQLRollback=0, MySQLTestFunc=None) # add test function (used by MySQL connection cache to test # connections before handing them out) MySQL.connection_test = Configuration.MySQLTestFunc for u, p in Configuration.MySQLConnectParams.items(): MySQL.initUser(u, p) # optional rollback def rollback(*args): for v in MySQL._connections.values(): try: v.rollback() except: pass if Configuration.MySQLRollback: CleanupRequest.addFunction(rollback)
######################################################################## # # Copyright (C) 2003 Andrew T. Csillag <*****@*****.**>, # Jacob Smullyan <*****@*****.**> # # You may distribute under the terms of either the GNU General # Public License or the SkunkWeb License, as specified in the # README file. # ######################################################################## # contributed by Brian Olsen. from SkunkWeb import Configuration import Firebird Configuration.mergeDefaults( FirebirdConnectParams = {}, ) for u, p in Configuration.FirebirdConnectParams.items(): Firebird.initUser(u, p) def rollback(*args): for v in Firebird._connections.values(): v.rollback() from requestHandler.requestHandler import CleanupRequest CleanupRequest.addFunction(rollback)
# GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. # from SkunkWeb import Configuration, LogObj, ServiceRegistry from requestHandler.requestHandler import CleanupRequest import Oracle ServiceRegistry.registerService('oracle') Configuration.mergeDefaults( OracleConnectStrings = {}, OracleProcedurePackageLists = {} ) for u, str in Configuration.OracleConnectStrings.items(): LogObj.DEBUG(ServiceRegistry.ORACLE, 'initializing user %s' % u) Oracle.initUser(u, str) for u, pkglist in Configuration.OracleProcedurePackageLists: Oracle.loadSignatures(u, pkglist, LogObj.LOG, lambda x: LogObj.DEBUG(ServiceRegistry.ORACLE, x)) def rollbackConnection(*args): for v in Oracle._connections.values(): v.rollback() CleanupRequest.addFunction(rollbackConnection)