I used a CMP entity bean to manipulate a Oracle table with a BLOB column: content. But when I call setContent(bytes) in my client call, I got the following exception:
java.io.IOException: ORA-22920: row containing the LOB value is not locked
ORA-06512: at "SYS.DBMS_LOB", line 700
Can any help me to fix this problem?
Thanks in advance!
You most likely need to tell your application server that you are dealing with blobs. This is application server specific... what app server are you using?
Thanks Daniel. I am using WebLogic4.1sp2 as my aplication server. I did specify the blob type in the deploy descript file: weblogic-cmp-rdbms-jar.xml with the following nodes:
Acturally the error message is pretty clear, that the row needs to be locked. My question is how do achieve this in CMP entity bean?
Sorry, a typo in my reply. Server should be WLS6.1sp2
Ok, your WLS version is OK.
You will need to add this into the weblogic-ejb-jar.xml (add it just before the </weblogic-ejb-jar> tag).
Where **YourEJBName** should be the name of your ejb as set in the xml, and **YourSetMethodForBlob** should be "setContent".
One more warning: Weblobic 6.1 has what I think is a bug in dealing with BLOBS. It can only store serialised objects. This is O.K. while you are only using java to access the DB, but if you try to access the same BLOB column with both java and something else, it isn't going to work. Hopefully they'll fix this some time.
Hope that helps,