Supporting and Recovering Transactions

Description

Commit/rollback for LOB data changes are supported. That is, it ensures the validation of mapping between LOB Locator and actual LOB data within transactions, and it supports recovery during DB errors. This means that an error will be displayed in case of mapping errors between LOB Locator and LOB data due to the rollback of the relevant transactions, as the database is terminated during transactions. See the example below.

Example

;AUTOCOMMIT OFF

 

CREATE TABLE doc_t (doc_id VARCHAR(64) PRIMARY KEY, content CLOB);

INSERT INTO doc_t VALUES ('doc-10', CHAR_TO_CLOB('This is content'));

COMMIT;

UPDATE doc_t SET content = CHAR_TO_CLOB('This is content 2') where doc_id = 'doc-10';

ROLLBACK;

SELECT doc_id, CLOB_TO_CHAR(content) FROM doc_t WHERE doc_id = 'doc-10';

  doc_id   content                  

=========================================================

  'doc-10'  'This is content '

 

INSERT INTO doc_t VALUES ('doc-11', CHAR_TO_CLOB ('This is content'));

COMMIT;

UPDATE doc_t SET content = CHAR_TO_CLOB('This is content 3') WHERE doc_id = 'doc-11';

 

-- system crash occurred and then restart server

SELECT doc_id, CLOB_TO_CHAR(content) FROM doc_t WHERE doc_id = 'doc-11';

 

-- Error : LOB Locator references to the previous LOB data because only LOB Locator is rollbacked.

Remark

Caution Up to CUBRID 2008 R3.0, Large Objects are processed by using glo (Generalized Large Object) classes. However, the glo classes has been deprecated since the CUBRID 2008 R3.1. Instead of it, LOB/CLOB data type is supported. Hence, both DB schema and application must be modified when upgrading CUBRID in an environment using the previous version of glo classes.