Search
Duplicate
⌨️

νŠΈλžœμž­μ…˜

β€’
논리적 μž‘μ—…μ˜ λ‹¨μœ„ λ˜λŠ” μž‘μ—…μ˜ 묢음

ACID

β€’
Atomic(μ›μžμ„±):
β—¦
νŠΈλžœμž­μ…˜μ˜ μž‘μ—…μ€ λͺ¨λ‘ μ‹€ν–‰λ˜κ±°λ‚˜ λͺ¨λ‘ μ‹€νŒ¨ν•˜μ—¬μ•Ό ν•œλ‹€.
β—¦
ex)
β—¦
INSERT INTO table VALUES (2, β€˜tommy’);
β—¦
INSERT INTO table VALUES (1, β€˜eden’), (2, β€˜tommy’);
β€’
Consistency(일관성): νŠΈλžœμž­μ…˜μ΄ μ‹œμž‘λ˜κΈ° μ „κ³Ό 끝났을 λ•Œλ₯Ό 비ꡐ μ–΄λ–€ νŠΉμ • ν…Œμ΄λΈ”λ§Œ λ³€κ²½ λ˜μ—ˆμ„ λ•Œ μ΄λŸ°κ±°λŠ” μ΄μ•ΌκΈ°ν•˜μ§€ μ•ŠμŒ
β€’
Isolation(격리성):
β€’
Durability(지속성): μ’€ 신기함.

격리 μˆ˜μ€€

β€’
read uncommitted
β€’
read committed
β€’
repeatable read
β€’
serializaable
β€’
InnoDB 의 기본값은 repeatable read
β€’
repeatable read λΆ€ν„°λŠ” 읽기 μ „μ˜ commit 을 μ½λŠ”λ‹€. 읽고 λ‚˜μ„œ λ‹€λ₯Έ transaction μ—μ„œ commit이 μΌμ–΄λ‚˜λ©΄ 변경점에 λŒ€ν•΄ 읽지 μ•ŠλŠ”λ‹€.
β€’
InnoDB repeatable read μ—μ„œ λ‹€λ₯Έ νŠΈλžœμž­μ…˜μ—μ„œ μ—…λ°μ΄νŠΈ 되고 컀밋 된 λ’€ 읽기만 ν–ˆμ„ λ•ŒλŠ” νŒ¬ν…€ λ¦¬λ“œκ°€ λ°œμƒν•˜μ§€ μ•ŠλŠ”λ‹€. μ½μ—ˆμ„ λ•Œ μ—†μ—ˆλ˜ row 에 λŒ€ν•΄ update λ₯Ό 치면 update κ°€ 되고 νŒ¬ν…€ λ¦¬λ“œκ°€ λ°œμƒν•œλ‹€.

Local Transaction vs Global Transaction

β€’
Local Transaction
β—¦
ν•˜λ‚˜μ˜ Datasource μ—μ„œ λ°œμƒν•˜λŠ” 자체적인 νŠΈλžœμž­μ…˜λ§Œ 관리
β€’
Global Transaction
β—¦
μ—¬λŸ¬κ°œμ˜ Datasourceμ—μ„œ λ°œμƒν•˜λŠ” νŠΈλžœμž­μ…˜μ„ 관리
β—¦
μ—¬λŸ¬ data source (볡수의 DB μ—°κ²°, JMSλ“±λ“±) μ—μ„œ μž‘μ—…μ„ μˆ˜ν–‰ν•˜κ³  전체 μž‘μ—…μ„ commit ν•˜κ±°λ‚˜ rollbackν• μˆ˜ 있게 ν•˜λŠ”κ²ƒμ„ 의미

JTA

β€’
manage multiple resources of different types in a consistent and coordinated manner .