Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9daa284

Browse files
committed
2024-07-06 00:15 Studied transaction
1 parent 6f71794 commit 9daa284

2 files changed

+36
-6
lines changed
Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: SQL의 속성, μ˜΅μ…˜, κΈ°λ³Έν‚€, μ™Έλž˜ν‚€, λͺ…λ Ήμ–΄, join κ°œλ… μ†Œκ°œ
3-
date: 2024-07-01 18:00:00 +09:00
2+
title: SQL의 속성, μ˜΅μ…˜, κΈ°λ³Έν‚€, μ™Έλž˜ν‚€, λͺ…λ Ήμ–΄, νŠΈλžœμž­μ…˜ κ°œλ…
3+
date: 2024-07-06 18:00:00 +09:00
44
categories: [1. Fundamental, Database]
55
tags: [Database, Fundamental, DBMS, Spring, Model, MVC, DB, Connection]
66
---
77

8-
<!-- 2024-07-01 κΈ€ μž‘μ„± μ‹œμž‘; 2099-01-01 νŽ˜μ΄μ§€ 호좜 μ™„λ£Œ -->
9-
<h2>κ°•μ˜ λ‚΄μš© 볡슡 : 코리아IT μ‹ μ΄Œμ  κ°•μ˜ (2024-05-10,16 κ°•μ˜)</h2>
8+
<!-- 2024-07-01 κΈ€ μž‘μ„± μ‹œμž‘; 2024-07-06 νŽ˜μ΄μ§€ 호좜 μ™„λ£Œ -->
9+
<h2>κ°•μ˜ λ‚΄μš© 볡슡 : 코리아IT μ‹ μ΄Œμ  κ°•μ˜ (2024-05-10 κ°•μ˜)</h2>
1010
> - Tool :
1111
<img alt="SQL" src="https://img.shields.io/badge/-SQL-336791?style=flat-square&logo=sqlite&logoColor=white" />
1212
@@ -256,7 +256,37 @@ drop table if exists js_member;
256256
<br>
257257

258258
### πŸ”” Transaction
259-
###
259+
### πŸ“Œ Transaction μ†Œκ°œ
260+
> - Transaction은 μž‘μ—…μ΄ μ „λΆ€ μ„±κ³΅μ μœΌλ‘œ 진행될 경우 μ½”λ“œλ₯Ό μ‹€ν–‰μ‹œν‚€λŠ” κΈ°λŠ₯을 μ œκ³΅ν•©λ‹ˆλ‹€.
261+
> - 또힌 μ˜ˆμ•½λœ μž‘μ—…μ΄ ν•˜λ‚˜λΌλ„ μ‹€νŒ¨ν•  경우 λͺ¨λ“  μž‘μ—…μ„ μ·¨μ†Œν•˜λŠ” κΈ°λŠ₯을 μ œκ³΅ν•©λ‹ˆλ‹€.
262+
> - 이와 같은 νŠΉμ„±μ΄ 있기 λ•Œλ¬Έμ— transaction은 μž…μΆœκΈˆκ³Ό 같은 금육 μ‹œμŠ€ν…œμ— μ‚¬μš©λ©λ‹ˆλ‹€.
263+
> - μ•„λž˜λŠ” transaction을 κ΅¬ν˜„ν•˜κΈ° μœ„ν•΄ ν•„μš”ν•œ rollback 및 commit에 λŒ€ν•œ μ„€λͺ…μž…λ‹ˆλ‹€.
264+
265+
### πŸ“Œ Rollback
266+
> - Rollback은 쑰건에 λΆ€ν•©λ˜μ§€ μ•ŠλŠ” μž‘μ—…μ„ commit μ „ μ‹œμ μœΌλ‘œ νšŒκΈ°μ‹œν‚€λŠ” κΈ°λŠ₯을 μ œκ³΅ν•©λ‹ˆλ‹€.
267+
> - 예λ₯Όλ“€μ–΄ μ†‘κΈˆμ„ μ›ν•˜λŠ” κ³„μ’Œμ˜ μž”μ•‘μ΄ λΆ€μ‘±ν•˜λ©΄ μ†‘κΈˆ 과정을 μ·¨μ†Œμ‹œν‚€λŠ” κΈ°λŠ₯을 κ΅¬ν˜„ν•©λ‹ˆλ‹€.
268+
269+
### πŸ“Œ Commit
270+
> - Commit은 쑰건에 μΆ©μ‘±λ˜λŠ” μž‘μ—…μ„ 톡해 λ³€κ²½λœ 사항을 DB에 λ°˜μ˜ν•˜λŠ” κΈ°λŠ₯을 μ œκ³΅ν•©λ‹ˆλ‹€.
271+
> - Commit의 μž₯점은 λ°μ΄ν„°μ˜ μ‚½μž…, μˆ˜μ •, μ‚­μ œ λ“±μ˜ λ‚΄μš©μ„ 반영ꡬ적으둜 μ²˜λ¦¬ν•œλ‹€λŠ” κ²ƒμž…λ‹ˆλ‹€.
272+
> - μ•„λž˜λŠ” transaction μ‚¬μš© μ˜ˆμ‹œμž…λ‹ˆλ‹€.
273+
274+
### πŸ“Œ Transaction μ‚¬μš© μ˜ˆμ‹œ
275+
> - Transaction 등을 톡해 κ°„νŽΈν™” 된 μž…μΆœκΈˆ μ‹œμŠ€ν…œμ„ κ΅¬ν˜„ν•˜μ˜€μŠ΅λ‹ˆλ‹€.
276+
> - 좜금 κ³„μ’Œμ—μ„œ μž…κΈˆ κ³„μ’Œλ‘œ 10,000원을 μ΄μ²΄ν•˜μ˜€μŠ΅λ‹ˆλ‹€.
277+
> - μ΄λ•Œ rollback 및 commit κ΄€λ ¨ λΉ„μ¦ˆλ‹ˆμŠ€ λ‘œμ§μ€ μ„œλΉ„μŠ€ 객체 λ“±μ—μ„œ μ²˜λ¦¬λ©λ‹ˆλ‹€.
278+
279+
``` sql
280+
begin transaction;
281+
282+
update account_out
283+
set balance = balance - 10000
284+
where account_number = '110123123456';
285+
286+
update account_in
287+
set balance = balance + 10000
288+
where account_number = '110321654321';
289+
```
260290

261291
<br>
262292
<br>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: GPR λΆ„μ„κ³΅λ™μ‘°μ‚¬μ„œ μžλ™ν™” ν”„λ‘œκ·Έλž¨ 개발 ν”„λ‘œμ νŠΈ
3-
date: 2024-07-05 18:00:00 +09:00
3+
date: 2099-01-01 18:00:00 +09:00
44
categories: [2. Main Project, Automation Software]
55
tags: [GPR, Ground Penetrating Radar, Input, Output, InputStream, OutputStream, File, File Processing, Image Processing, Automation Software, Automation Program, Data Storage Method, Data Storage, Data Stream]
66
---

0 commit comments

Comments
Β (0)