본문 바로가기
728x90
반응형

분류 전체보기273

[DataBase]MVCC MVCC는 commit된 데이터만 읽는다. 데이터를 읽을 때 특정 시점 기준으로 가장 최근에 commit된 데이터를 읽는다. 데이터 변화 이력을 관리한다. read와 write는 서로를 block하지 않는다. MVCC 예제 x=10 Transaction1 x를 읽는다. Transaction2 x를 50으로 바꾼다. 시작 Transaction2에서 x를 50으로 바꾼다. write(x=50) 트랜잭션 2만 알 수 있는 공간에 x=50을 적는다. Transaction1에서 x를 읽는다. read(x) → 10 Transaction2 commit → x = 50 Isolation Level이 read committed라면 Transaction1에서 x를 읽는다. read(x) → 50 Isolation Lev.. 2023. 8. 4.
[DataBase] Transactional Isolation Level Dirty Read → commit되지 않은 변화를 읽음. x= 10, y = 70 Transaction1 x에 y를 더한다. Transaction2 y를 70으로 바꾼다. 시작 transaction1에서 x를 읽는다. read(x) → 10 transaction2에서 y를 70으로 바꾼다. write(y=70) transaction1에서 다시 x를 읽는다. read(y) → 70 transaction1에서 x에 y를 더한다. write(x=80) transaction1 commit하고 종료 transaction2에서 abort되어서 rollback되어서 (y=20) 문제점 transaction1은 write한 70을 읽었는데, transaction2는 Rollback되어서 70은 유효한 값이 아니다. .. 2023. 8. 3.
프로그래머스 - 기사단원의 무기 class Solution { public int solution(int number, int limit, int power) { int answer = 0; for(int i=1; i 2023. 5. 8.
프로그래머스 - 연속 부분 수열 합의 개수 import java.util.*; class Solution { public int solution(int[] elements) { Set set = new HashSet(); int count = 1; int len = elements.length; while(count != len+1){ for(int i=0; i 2023. 5. 6.
728x90
반응형