Problem Explanation: ====================  The above sql statements were executed within a for loop. After each fetch a call to dbms_lob.copy is made followed by commit within  the loop.  Fetching accross commits is not allowed since it results to cursor invalidation because the a COMMIT release any locks held by the session.  From Oracle 8 Server Application Developer's Guide, Chapter 6, Large Objects: The insert statement automatically starts a transaction and locks the row.   Once it has occurred, the locator may not be used outside the current  transaction, since a COMMIT release any locks.  Therefore any fetch after the lock will result in ORA-22990: LOB locators  cannot span transactions.   Problem References: ===================  Oracle 8 Server Application Developer's Guide  Search Words: =============  ORA-22990: lob locator cannot span transaction  Solution: ========= It is not advisable to use a COMMIT inside a loop. Use commit after the loop ends. 
.

解决方案 »

  1.   

    ORA-22990 LOB locators cannot span transactions
    Cause: A LOB locator selected in one transaction cannot be used in a different transaction.
    Action: Reselect the LOB locator and retry the operation.
    意思是说在一个transaction查询使用的lob定位不能在另一个transaction里面使用,要在新的transaction使用的话要重新打开,重新定位