Chen Jian

Notes on ‘Expert Oracle’ — No.8: Transaction

1. Transaction: … 2. Transaction in Loop    We prefer "Transaction after Loop" to "Transaction in Loop".     a. "Transaction in Loop" => Too many seperated transactions => Not Atomic     b. "Transaction in Loop" commits frequently => Undo Log more easily erased, since transaction already commited => When "restart" happens, you may see "Snap …

Notes on ‘Expert Oracle’ — No.8: Transaction Read More »

maxPostSize in Tomcat and in JBOSS

If a http post exceeds the size the ‘maxPostSize’,    Tomcat will thrown an "post too large" exception and return HTTP 500.    But JBoss will just discard the posted values and go on.

Notes on ‘Expert Oracle’ — No.7.2: Concurrency–Write Consistency

1. You have already known about "Read Consistency" — 如果数据在语句/事务开始时没变化,就返回这行数据;否则,从回滚段里读它的Snapshot. 这叫做"Consistent Read" 2. 与之相对的是 “Current Read” — 不去读回滚段,而是从当前数据文件里去读。    a. When does it happen? 在准备修改数据时进行Current Read    b. 举例说明,        Update t set y = 1 where x = 5           i.首先会执行 "select .. from t where x = 5",这个过程使用的是"Consistent Read",即找到回滚段里满足 x = 5的记录            …

Notes on ‘Expert Oracle’ — No.7.2: Concurrency–Write Consistency Read More »

Notes on ‘Expert Oracle’ — No.7.1: Concurrency–Concurrency with Multi-version

1. Oracle除了用锁实现并发控制,还利用了“多版本机制”— 一条数据除了会记在表文件里,还会记在“回滚段”里。 2. 具体的并发控制策略    a.ANSI标准定义的并发控制级别(从低到高)       i. Read Uncommited (可以读到脏数据)      ii. Read Commited   (不能读到脏数据)      iii. Repeatable Read (在同一个事务里两次读某条数据,读到的值一定是一样的。一个典型的反面例子是“丢失更新”)      iv. Serializable (不但可以重复读,而且还可以保证没有 幻读)         b.Oracle支持哪些级别?       i.Read Uncommited — 在Oracle中想脏读都读不到!      ii. Read Commited  — 支持,是Oracle的默认级别。Oralce不仅支持这个级别, 而且还有所增强:可以保证 “读一致性”(见下文)      iii. Repeatable Read — 不直接支持。需自己编程实现。      iv. Serializable — 支持。但是由于未使用锁机制,因此 不能真正地实现“串行” …

Notes on ‘Expert Oracle’ — No.7.1: Concurrency–Concurrency with Multi-version Read More »

Notes on ‘Expert Oracle’ — No.6.3: Locking — Locking Types

1. DML Locks   a. TX Lock      i. Preventing other transactions from updating the same row     ii. Unlike other databases, it’s not costy for Oracle to have many Locks   b. TM Lock: Preventing others from modifying the table structure while I am updating its data 2. DDL Locks    a. Exclusive DDL …

Notes on ‘Expert Oracle’ — No.6.3: Locking — Locking Types Read More »

Notes on ‘Expert Oracle’ — No.6.2: Locking — Blocking, Deadlock & Escalation

1. Blocking: … 2. Deadlock: … 3. What will cause deadlock in Oracle?    It may happen when you try to delete a row in the parent table of which the child table has no indexes on foreign keys. Because in this case the child table will be locked as whole and it increase the …

Notes on ‘Expert Oracle’ — No.6.2: Locking — Blocking, Deadlock & Escalation Read More »

Notes on ‘Expert Oracle’ — No.6.1: Locking — Optimistic & Pessimistic

1. The problem: Lost Update       Example: Increase Count       Flow:         a. I query the count. It is 5         b. You increase the count immediately. It is 6 now.         c. I don’t know it is 6 now. I still assume it is 5. So I increase it by set it as 6. …

Notes on ‘Expert Oracle’ — No.6.1: Locking — Optimistic & Pessimistic Read More »

Notes on ‘Expert Oracle’ — No.5.1: Oracle Processes — Server Processes

1. Server Process   a.Dedicated Server: one TCP/IP connection, one server process   b.Shared Server: Serveral tcp/ip connections => one dispatcher => A pool of processes 2.Connection V.S. Session   In terms of Domain Logic, the two are not ‘associated’ with each other, they only ‘depend’ each other.    a. A connection is physical network …

Notes on ‘Expert Oracle’ — No.5.1: Oracle Processes — Server Processes Read More »