And from: http://docs.oracle.com/cd/B10500_01/appdev.920/a96591/adl05adv.htm#98415 "Modifying an internal LOB's value through the LOB locator using DBMS_LOB, OCI, or SQL INSERT or UPDATE statements changes the locator from a read consistent locator to an updated locator. Further, the INSERT or UPDATE statement automatically starts a transaction and locks the row. Once this has occurred, the locator may not be used outside the current transaction to modify the LOB value. In other words, LOB locators that are used to write data cannot span transactions"
Is my conclusion right that XA (JTA UserTransaction) can not involve insert of a BLOB? When I try to test my program code I get the ORA-error: ORA-22990
I don't think the sources you cited support your conclusion. The ORA-22990 simply means that you've ended your transaction too early. Though I don't use XA, I think it leaves it on you when a transaction commits/rolls back. XA just coordinates the transaction among different systems.
I'd suggest to check whether you don't have an autocommit set on your connection. That would produce the ORA-22990 error even if you didn't use distributed transactions. (Amazingly, the autocommit is on by default in JDBC.)
Joined: Dec 01, 2011
I thought about autocommit too. Doesn't seam to help though. If I don't use blobOutputStream.flush(); the blob is never saved to the database. The program runs fine if I take the tx.begin(); and tx.commit(); away.
Quick search through Oracle9i Application Developer's Guide - Large Objects (LOBs) does not yield anything about distributed transactions. I don't think it is generally impossible to modify LOBs in distributed environments, but maybe there is some incompatibility in your specific environment. Could you use sql trace to see when the commits happen and align them with commands being run on your application?
Reading the guide mentioned above (in version corresponding to your database) might be useful too. Maybe some scenario involving temporary BLOBs could help you sail through in your environment.