1
설명서를 읽고 나면 트랜잭션에서 한 번만 커밋해야한다는 것을 알았습니까?연결 커밋 기능 Python
다음은 하나의 트랜잭션으로 계산합니까? 아니면 각 함수가 트랜잭션으로 계산합니까?
def main():
conn=pyodbc.connect(sqlconnectionstring) # Assume this connects to the database
cursor = conn.cursor()
function1()
function2()
conn.commit()
def function1():
# does inserting here
def function2():
# does inserting here and calls function 3
function3()
def function 3():
# does more inserting here
main()
충분히 conn.commit()가 모든 기능의 모든 삽입을 저지하기 위해 또는 내가 인수로 "코네티컷"변수를 전달하고 각 함수 내에서 커밋해야인가요?
감사합니다.