Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 8.4.3 |  CUBRID 9.0.0 | 

Supporting and Recovering Transactions

Definition

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

csql> ;AUTOCOMMIT OFF

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

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

csql> commit;

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

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

 

=== <Result of SELECT Command in Line 1> ===

  doc_id         content

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

  'doc-10'       'This is content '

 

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

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

 

//system crash occurred and then restart server

csql> 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.

Note
  • When selecting LOB data in an application through a driver such as JDBC, the driver can get ResultSet from DB server and fetch the record while changing the cursor location on Resultset. That is, only Locator, the LOB column value, is stored at the time ResultSet is imported, and LOB data that is referred by a File Locator will be fetched from the file Locator at the time a record is fetched. Therefore, if LOB data is updated between two different points of time, there could be an error, as the mapping of LOB Locator and actual LOB data will be invalid.
  • Since backup/recovery is supported only for LOB type column value (Locator), an error is likely to occur, as the mapping of LOB Locator and LOB data is invalid if recovery is performed based on a specific point of time.
  • If the DB is operated in different equipment like S1 and S2, and you want to store LOB data in the DB of S1 equipment to S2 equipment, you must read the LOB data which the LOB column value of S1 equipment is referring to, and INSERT LOB. The LOB column value (Locator) of S1 equipment is valid only in the relevant local system.

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.