What happens exactly when AutoCommit is "off"?

조회 수: 1 (최근 30일)
David Goldsmith
David Goldsmith 2011년 8월 1일
Hi! What exactly do fastinsert, etc., do when AutoCommit is set to off: an actual "push," or a simulation thereof? Put another way, is one obliged to use rollback to undo an insert even if AutoCommit is set to off? Is there any other way to "simulate" an insert w/out actually pushing data to the DB?
Thanks!

채택된 답변

Titus Edelhofer
Titus Edelhofer 2011년 8월 1일
Hi,
the autocommit is handled on the database side. Depending on the database at hand, the table where the insert is done, is locked, such that queries on this table are queued until the insert is either commited or rolled back. So, yes, you have to commit/rollback (although usually the rollback is done automatically after some timeout).
Usually you use autocommit=off to be sure about having multiple inserts done "simultaenously", i.e. do some insert statements after each other. If all go well, commit, if one of them fails, rollback (all) of them.
Titus
  댓글 수: 1
David Goldsmith
David Goldsmith 2011년 8월 1일
Excellent, thanks! Good info, well-stated: I vote for it being added to the official documentation of fastinsert! (Or as a separate entry documenting the AutoCommit state.) :-)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Just for fun에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by