Database - TCL (Transaction Control Language)- Commit, Rollback, Save point, Lock 🧁🍬

화이티 Β·2024λ…„ 1μ›” 2일
0

Database

λͺ©λ‘ 보기
6/8

TCL Transaction Control Language: νŠΈλžœμž­μ…˜ μ œμ–΄λ₯Ό λ‹΄λ‹Ή
-> 그럼 μ—¬κΈ°μ„œ νŠΈλžœμž­μ…˜μ΄λž€? μͺΌκ°€ 수 μ—†λŠ” 업무 처리의 μ΅œμ†Œ λ‹¨μœ„
λ°μ΄ν„°λ°°μ΄μŠ€μ—μ„œλŠ” μƒνƒœλ₯Ό λ³€ν™”μ‹œν‚€κΈ° μœ„ν•΄ μˆ˜ν–‰ν•˜λŠ” μž‘μ—…μ˜ λ‹¨μœ„

1. Commit/Rollback


  • COMMIT;
    => λ§ˆμ§€λ§‰ COMMIT μ‹œμ  이후 μ‹€ν–‰ν•œ νŠΈλžœμž­μ…˜ κ²°κ³Όλ₯Ό λ°μ΄ν„°λ°°μ΄μŠ€μ— 영ꡬ μ €μž₯
  • ROLLBACK;
    =>μ‹€ν–‰ν•œ νŠΈλžœμž­μ…˜ 결과에 λŒ€ν•΄μ„œ μ‹€ν–‰ν•˜κΈ° μ „ μƒνƒœλ‘œ 완성볡ꡬ
    => λ§ˆμ§€λ§‰μœΌλ‘œ COMMITν•œ μ‹œμ κΉŒμ§€λ§Œ ROLLBACKκ°€λŠ₯
    보톡 DML (UPDATE, INSERT, DELETE)ν•œ λŒ€μƒμ€ λ°”λ‘œ ν…Œμ΄λΈ”μ— 영ꡬ λ°˜μ˜λ˜λŠ” 것이 μ•„λ‹ˆλ―€λ‘œ COMMIT을 λͺ…μ‹œν•΄μ•Ό 반영


2. SAVEPOINT

SAVEPOINT λž€? ROLLBACK λͺ…령어에 λŒ€ν•΄ νŠΉμ • μ§€μ κΉŒμ§€λ§Œ λ³΅κ΅¬ν•˜λ„λ‘ 쑰절

3. LOCK

LOCK은 λ‘˜ μ΄μƒμ˜ μ„Έμ…˜μΈ - λ˜‘κ°™μ€ 행을 μ‘°μž‘ν•˜λ €κ³  ν•  λ•Œ μΆ©λŒν•˜λŠ” ν˜„μƒ (베타 LOCK)




profile
μ—΄μ‹¬νžˆ κ³΅λΆ€ν•©μ‹œλ‹€! The best is yet to come! πŸ’œ

0개의 λŒ“κΈ€