Hello

In my try-Except block I have a db update to update database back to 
initial value if code fail. Looks like update is not executed.

except Exception as e:
    "Če je napaka pri ustavljanju woshi engina"
    #db.rollback()
    db(db.scripts.id == scriptId).update(sc_status = 10)
    db.commit()
    print db._lastsql
    print "skripta %s v status 10!" %(str(scriptId))
    "pobrišemo tudi datoteke ker drugače bo engine še kr laufov"
    #Pobiršem out file če obstaja v mapi engine/e1 in sc_engine_out
    count = 0
    outPath= os.path.join(request.folder, 'engine', 'e1', str(scriptId) + 
'.out')
    while (count < 5 and ( os.path.isfile(outPath))):
        count += 1
        os.remove(outPath)
        time.sleep(0.05)

    count = 0
    llsFle = os.path.join(request.folder, 'engine', 'e1', str(scriptId) + 
'.lls')
    while (count < 5 and (os.path.isfile(llsFle))):
        count += 1
        os.remove(llsFle)
        time.sleep(0.05)


    exc_type, exc_obj, exc_tb = sys.exc_info()
    fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
    errmsg = ["error pri parseOut funkciji", exc_type, fname, 
exc_tb.tb_lineno,e.__doc__ , e.message]
    print "errmsg ", errmsg
    print(exc_type, fname, exc_tb.tb_lineno)
    print e.__doc__
    print e.message
    #Writte error to log file
    exceptionLogger(errmsg, scriptId, org, auth.user_id)
    return {"error" : 666}




I tried with db.rollback() and it is the same. The print is shown, also the 
sql UPDATE scripts SET sc_status=10 WHERE (scripts.id = 434); is correct  
and it works if executed on database.

any suggestions??

thank you


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to