Oracle Locks - LOBs

kbrye

Member
We have several applications that use lobs. We've encountered locking issues with one of them. We insert a tif into the database (from a scanner) with the following code:
OracleInsertQuery.SetVariable('LET_ID', StrToInt(LetId));
LOB:= TLOBLocator.Create(OracleSession1,otBlob);
OracleInsertQuery.SetComplexVariable('LETTER_IMAGE',LOB);
OracleInsertQuery.Execute;
LOB.LoadFromFile(FileName);
LOB.Free;
OracleSession1.Commit;

The first application then ends the connection and closes down. Another application then selects for update with no wait the record that was inserted from above (several seconds in between). The second application receives error 54, resource busy frequently, but not all the time. Any suggestions on how to track down this locking problem would be most appreciated.

Kent
 
When this session commits, or when the application is successfully stopped, it can no longer have any locks. Perhaps you can examine the v$lock view to determine the cause of this lock?

------------------
Marco Kalter
Allround Automations
 
Originally posted by mkalter:
When this session commits, or when the application is successfully stopped, it can no longer have any locks. Perhaps you can examine the v$lock view to determine the cause of this lock?

Thanks. We had done that, but more importantly I believe we have found the problem. We were doing a select with update and had locked another table by doing this (through a join) and did not take that into account. We've changed the syntax and are not seeing the problem.

Thanks again.
 
Can you post the corrected code?

I'm having the opposite problem when I try to loadfromfile I get a:

"Project OPP.exe raised exception class EOracleError with message 'ORA-22920: row containing the LOB is not locked'."
 
Back
Top