Exemple #1
0
 def getConnection(self):
     return PsycopgCache.getConnection(
         Configuration.SessionHandler_PsycopgAlias)
Exemple #2
0
########################################################################
#  Copyright (C) 2004 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.
########################################################################

from SkunkWeb import Configuration
import PsycopgCache

Configuration.mergeDefaults(PsycopgConnectParams = {})

for u, p in Configuration.PsycopgConnectParams.items():
    PsycopgCache.initUser (u, p)

def rollback(*args):
    for v in PsycopgCache._connections.values():
        v.rollback()

from requestHandler.requestHandler import CleanupRequest
CleanupRequest.addFunction(rollback)
 def getConnection(self):
     return PsycopgCache.getConnection(Configuration.SessionHandler_PsycopgAlias)