# TiDB Online DDL
+ When metadata lock is off, DML does not block DDL from other sessions.
  + It is recommended that the client should handle exceptions: ERROR 8028 (HY000)
+ When metadata lock is on, DML blocks DDL from other sessions.
+ But does not further block other DMLs.

![`smart`](OnlineDDLMetaLockOffLongTx_en_001_20230613.png)
![`smart`](OnlineDDLMetaLockOffShortTx8028_en_001_20230613.png)
![`smart`](OnlineDDLMetaLockOnLongTx_en_001_20230613.png)

------------------------------------------------------------
Tidb_metadata_lock = off

Class demo scripts:

https://github.com/pingcap/tidb-course-201-lab/blob/master/scripts/07-demo-online-ddl-add-column-01-workload-before.sh

https://github.com/pingcap/tidb-course-201-lab/blob/master/scripts/07-demo-online-ddl-add-column-02-workload-after.sh

Since DML operations do not block DDL operations from other sessions, when a DML in a transaction encounters a table schema change, you can choose to abandon the transaction or re-commit it.

