Hi
I have two function one is running in controller when users access the
page (manageGame) and one is running as cron job (cleanDB). I am
geting   "Lock wait timeout exceeded; Try restarting transaction"
error in mysql database.
How can I avoid this problem ?

def manageGame():
    now = datetime.datetime.now()
    activeBigGame = db((db.games.LotteryDrawTime > now) &
(db.games.Type == 'Big Game') & (db.games.active == 'Yes')).select()
    activeone_of_7 = db((db.games.Type == '1 of 7')& (db.games.active
== 'Yes') & (db.games.LotteryDrawTime > now)).select()
    db(db.games.LotteryDrawTime < now).update(active = 'No')
......




def cleanDB(now):
    db((db.games.LotteryDrawTime < now) &(db.games.numberPlayer ==
0) ).delete()



Thanx Frasse

Reply via email to