def dbLocker( dbLock , func , *prm , **kprm ) :
    """Grant exclusive DB access while executing the passed function.
    The 'dbLocker' function executes the 'dbLock.acquire()' and 'dbLock.release()' 
    methods on entry and exit, respectively, assuring the executed 
    function 'func' has an exclusive access to the DB. 'prm' and 'kprm' 
    are the optional 'func' function parameters. 
    The 'dbLocker' function returns the returning value of the passed
    'func' function. """ 

    dbLock.acquire()
    try: 
        rv = func( *prm , **kprm ) 
    except: 
        dbLock.release()
        raise 
    dbLock.release()
    return rv