transaction

pool 객체를 트랜잭션과 함께 쓰지마라. Do not use pool.query if you need transactional integrity: the pool will dispatch every query passed to pool.query on the first available idle client. Transactions within PostgreSQL are scoped to a single client and so dispatching individual queries within a single transaction across multiple, random clients will cause big problems in your app and not work. For more info ..
🎯 Goals 트랜잭션의 사용 방법을 알아본다. 트랜잭션이 동작 원리를 그림으로 정리한다. 동작원리 이해를 위해 WAL, CDC가 무엇인지 알아본다. 1. 트랜잭션 사용 방법 BEGIN 트랜잭션 블록 초기화 키워드로 모든 문장을 하나의 트랜잭션으로 묶는다. `COMMIT` `ROLLBACK` 연산을 만나기 전까지 Automacity 를 보장하는 대 신 CPU/Disk activity 가 있기 때문에 속도는 더 느리다. WITHOUT BEGIN 기본적으로 BEGIN 이 없으면 각각의 statement (쿼리문)이 독립된 트랜잭션이 된다. 속도는 더 빠르다. 📝 이럴 때 트랜잭션을 써라 All or Nothing 여러 쿼리가 하나의 작업 단위로 묶여야 할 때 다 실행되거나 다 안되거나 2. 트랜잭션의 동작 ..
M_Falcon
'transaction' 태그의 글 목록