Question: releasing value of BLOB field

Hello, I'm using EclipseLink 2.0.
I have an entity with @BLOB field, which is lazy loaded. After I update or persist an instance of the entity, I don't need the BLOB field value, because I need the memory to be free.
Can I make the BLOB field uninitialized without entity's refresh (as if the object is just queried)? Or the only way is to refresh the entity?

Refresh is the only public way.
There is an internal way, get the FetchGroup from the object and remove the blob attribute name from it (or set a new FetchGroup if null), then just null out the blob.
The class will be weaved to implement FetchGroupTracker, which provides the API to get and set the FetchGroup (or you can use the descriptor's FetchGroupManager).
James : http://www.eclipselink.org

Similar Messages

  • How to insert image file as a field value into blob field type using insert statment

    i have a column named picture of datatype BLOB
    now i want to insert an image file into that column using
    INSERT state so that it can be called in a jsp file using
    getBLOB request method.
    HELP!!
    thank you
    sal

    See this link
    http://www.psoug.org/reference/dbms_lob.html

  • Opening pdf appln from forms 6i when clicking on a blob field-extremely urgent please

    I was browsing through the discussion forum for my requirements and found
    the following code for opening a column value (a blob field) into an application.
    I wrote this following code in 'when-mouse-doubleclick' for the blob field
    in question, in forms 6i.
    When i compile,it does not give any error, but when i run the form and doubleclick
    on the relevant field, there opens a dos screen and then instantaneously
    closes. and nothing else happens.
    Please help me.
    thanks in advance.
    declare
    path varchar2(100);
    file varchar2(50);
    begin
    path:='C:\program files\adobe\acrobat4.0\reader\AcroRd32.exe';
    file:='C:\myfile.pdf';
    path:=path | | file;
    host(path);
    end;

    Hi Mohana,
    Your problem is probably spacing. Try this:
    declare
    path varchar2(100);
    file varchar2(50);
    begin
    path:='C:\program files\adobe\acrobat 4.0\reader\AcroRd32.exe ';
    file:='C:\myfile.pdf';
    path:=path | | file;
    host(path);
    end;
    What I've done differently is put a space between acrobat and 4.0, and a space at the end after .exe.
    null

  • Offline data migration fails for BLOB field from MySQL 5.0 to 11g

    I tried to use standalone Data Migration several years ago to move a database from MySQL to Oracle. At that time it was unable to migrate blob fields. I am trying again, hoping this issue might have been fixed in the mean time. That does not appear to be the case. The rows in question have a single BLOB field (it is a binary encoding of a serialized Java object, containing on the order of 1-2K bytes, a mixture of plain text and a small amount of non-ASCII data which is presumably part of the structure of the Java object). The mysqldump appears to correctly store the data, surrounded by the expected <EOFD> and <EORD> separators. The data as imported consists of a small (roughly 1-200) ASCII characters, apparently hex encoded, because if I do a hex dump of the mysqldump I can recognized some of the character pairs that appear in the blob field after import. However, they are apparently flipped within the word or otherwise displaced from each other (although both source and destinations machines are x86 family), and the imported record stops long before all the data is encoded.
    For example, here is a portion of the record as imported:
    ACED0005737200136A6
    and here is a hex dump of the input
    0000000 3633 3838 3037 3c39 4f45 4446 303e 3131
    0000020 3036 3830 3836 453c 464f 3e44 312d 453c
    0000040 464f 3e44 6e49 7473 7469 7475 6f69 446e
    0000060 7461 3c61 4f45 4446 ac3e 00ed 7305 0072
    0000100 6a13 7661 2e61 7475 6c69 482e 7361 7468
    0000120 6261 656c bb13 250f 4a21 b8e4 0003 4602
    0000140 0a00 6f6c 6461 6146 7463 726f 0049 7409
    0000160 7268 7365 6f68 646c 7078 403f 0000 0000
    AC ED appears in the 5th and 6th word of the 4th line, 00 05 in the 6th and 7th words, etc.
    I see explicit references to using hex encoding for MS SQL and other source DB's, but not for mysql.
    I suspect the encoder is hitting some character within the binary data that is aborting the encoding process, because so far the records I've looked at contain the same data (roughly 150 characters) for every record, and when I look at the binary input, it appears to be part of the Java object structure which may repeat for every record.
    Here is the ctl code:
    load data
    infile 'user_data_ext.txt' "str '<EORD>'"
    into table userinfo.user_data_ext
    fields terminated by '<EOFD>'
    trailing nullcols
    internal_id NULLIF internal_id = 'NULL',
    rt_number "DECODE(:rt_number, 'NULL', NULL, NULL, ' ', :rt_number)",
    member_number "DECODE(:member_number, 'NULL', NULL, NULL, ' ', :member_number)",
    object_type "DECODE(:object_type, 'NULL', NULL, NULL, ' ', :object_type)",
    object_data CHAR(2000000) NULLIF object_data = 'NULL'
    )

    It looks like the data is actually being converted correctly. What threw me off was the fact that the mysql client displays the actual blob bytes, while sqlplus automatically converts them to hex for display, but only shows about 2 lines of the hex data. When I check field lengths they are correct.

  • Retrieve XMLP documents directly from BLOB fields in E1; Tools Release 8.97

    Hi,
    I want to be able to retrieve XML Publisher reports (PDF, RTF, HTML) directly from the database BLOB fields in EnterpriseOne. Instead of making users manually save each report to get a soft-copy of the report, I wanted to be able to retrieve the reports from a BLOB field, create a new external file for it, and open the file with the related editor (MS Word, Adobe, IE, etc.).
    We are on Oracle 10g, and I was able to get a file populated with some BLOB data for a particular RTF file. However, when I try to open the file in MS Word, all I get is junk.
    Does anyone know if JDE stores these documents differently into BLOB fields than standard?
    Here is the code I used using PL/SQL...
    DECLARE
    xmlstr BLOB;
    warn VARCHAR2(400);
    v_file Utl_File.file_type;
    line_buf RAW(32767);
    maxbufsize BINARY_INTEGER := 32767;
    amount BINARY_INTEGER;
    offset BINARY_INTEGER;
    dir varchar2(50) := 'XMLP_DIR';
    filename varchar2(50) := 'JPARK_TEST.rtf';
    bsize NUMBER;
    BEGIN
    v_file := utl_file.fopen(dir,filename,'wb',maxbufsize);
    SELECT xorpdxpblb INTO xmlstr FROM sy812.F95631 WHERE xorpdorgud = '2115630440008e-SMNQTWZCFI-YEKRWCIOUA';
    --SELECT xdrpdubblb INTO xmlstr FROM sy812.F95630 WHERE xdrpduogud = '21080156900001-SMNQTWZCFI-ORORNYFSYJ';
    bsize := dbms_lob.getLength(xmlstr);
    dbms_output.put_line(bsize);
    amount := maxbufsize;
    offset := 1;
    WHILE (offset<bsize) LOOP
    DBMS_LOB.read(xmlstr,amount,offset,line_buf);
    utl_file.put_raw(v_file,line_buf, TRUE);
    offset := offset+amount;
    --utl_file.fflush(v_file);
    --Dbms_Output.put_line(offset);
    END LOOP;
    utl_file.fclose(v_file);
    EXCEPTION
    WHEN OTHERS THEN
    UTL_FILE.FCLOSE_ALL;
    DBMS_OUTPUT.PUT_LINE('WHEN OTHERS');
    dbms_output.put_line(substr(sqlerrm,1,254));
    END;

    the database and blob fields are identical. In the 11i (eBusiness suite) we would store this information in fnd_lobs.
    Ike Wiggins
    http://bipublisher.blogspot.com

  • Error displaying a jpg file loaded into a table with blob field

    This may not be the correct forum for this question, but if it isn't could someone direct me to the correct one.
    I have created a table with a blob field in which I have loaded a jpg image. This appeared to work correctly, but when I try to display the image in internet explorer it comes back and tells me that it doesn't recognize the file type. Enclosed is the table create, load, and display pl/sql code. Can anyone tell me what I am doing wrong. Thanks. For the mime/header I used owa_util.mime_header('images/jpg') because my image is a jpg file.
    The database is 10g
    -- Create table
    create table PHOTOS
    IMAGEID NUMBER(10),
    IMAGE BLOB,
    IMAGE_NAME VARCHAR2(50)
    load image
    CREATE OR REPLACE PROCEDURE load_file ( p_id number, p_photo_name in varchar2) IS
    src_file BFILE;
    dst_file BLOB;
    lgh_file BINARY_INTEGER;
    BEGIN
    src_file := bfilename('SNAPUNCH', p_photo_name);
    -- insert a NULL record to lock
    INSERT INTO photos (imageid, image_name, image)
    VALUES (p_id , p_photo_name, EMPTY_BLOB())
    RETURNING image INTO dst_file;
    -- lock record
    SELECT image
    INTO dst_file
    FROM photos
    WHERE imageid = p_id AND image_name = p_photo_name
    FOR UPDATE;
    -- open the file
    dbms_lob.fileopen(src_file, dbms_lob.file_readonly);
    -- determine length
    lgh_file := dbms_lob.getlength(src_file);
    -- read the file
    dbms_lob.loadfromfile(dst_file, src_file, lgh_file);
    -- update the blob field
    UPDATE photos
    SET image = dst_file
    WHERE imageid = p_id
    AND image_name = p_photo_name;
    -- close file
    dbms_lob.fileclose(src_file);
    END load_file;
    display image
    PROCEDURE display_image(p_id NUMBER) IS
    Photo BLOB;
    v_amt NUMBER DEFAULT 4096;
    v_off NUMBER DEFAULT 1;
    v_raw RAW(4096);
    BEGIN
    -- Get the blob image
    SELECT image
    INTO Photo
    FROM PHOTOS
    WHERE IMAGEID = p_id;
    owa_util.mime_header('images/jpg');
    BEGIN
    LOOP
    -- Read the BLOB
    dbms_lob.READ(Photo, v_amt, v_off, v_raw);
    -- Display image
    htp.prn(utl_raw.cast_to_varchar2(v_raw));
    v_off := v_off + v_amt;
    v_amt := 4096;
    END LOOP;
    dbms_lob.CLOSE(Photo);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    NULL;
    END;
    END;
    The url I enter is: http://webdev:7777/tisinfo/tis.tiss0011.Display_Image?p_id=1

    Just a little more information. When I enter owa_util.mime_header('image/jpeg') I can't display the file. It just shows up with a red x for the file.
    When I enter owa_util.mime_header('image/jpg') it displays the file, but in the format
    ¿¿¿¿JFIF¿¿-Intel(R) JPEG Library, version [2.0.16.48]¿¿C
    This is the way I would expect it to look if I opened it with Notepad, or an application that doesn't recognize jpg files. Can anyone tell me what I am doing wrong?? Thanks.

  • Problem with ojdbc14.jar (oracle10g Rel. 2 driver) in updating a BLOB field

    Hello All,
    Our web application uses oracle10g Release 2 jdbc driver with websphere 5.1.1.4 and oracle 9i. When it tries to update a BLOB field in the database updation is successful but it is updating that field with a null value. So rest of our application fails as this value is becoming null. We use an entity bean to update this table and websphere uses a prepared statement to update this table. Just before setting this BLOB field using setBinaryStream() on prepared statement I am printing to see whether it is null or not as shown in the code snippet below. And it is printing it correctly as non null. But after execution of the prepared statement some how the value stored in database is null.
    Is this a known issue with this driver? Does any one know work around or a solution to this? We have 3 BLOB fields in that table. Is that a problem? If we separate these BLOB fields into separate tables will the problem be solved? Any input on this is very much appreciated.
    // For column ORIGINAL_CONTENT
    byte[] tempbyteArray;
    tempbyteArray=(byte[])inputRecord.get(25);
    if (tempbyteArray == null) {
    System.out.println("DqPageBeanFunctionSet_f9c724af: tempbyteArray NULLLLLLL");
    } else {
    System.out.println("DqPageBeanFunctionSet_f9c724af: orig tempbyteArray length: " + tempbyteArray.length);
    if(tempbyteArray != null) {
    pstmt.setBinaryStream(25,new java.io.ByteArrayInputStream(tempbyteArray),tempbyteArray.length);
    else pstmt.setNull(25,java.sql.Types.BLOB);
    Thanks & Regards,
    -Sunitha

    I have similar problem and I solved it using ojdbc14.jar oracle9i version.
    try...

  • Problem building a trigger using a BLOB field in Oracle 10

    My case is the following,
    I'm trying to implement an AFTER trigger which uses the :new.blob_field to insert the new value in a table. Because of the documented AFTER restriction and :new use for blob fields, I've though to add other BEFORE trigger that calls a procedure in which I can store the :new value and later insert the temporary value in the table when the AFTER trigger is executed.
    The Idea is the following:
    BEFORE trigger :new -> TEMP
    and then
    AFTER trigger uses TEMP to store in the new table
    So, the final questions are the following:
    -Any other idea to do the same, that is, to use the ":new" value in an AFTER trigger?
    -How can I do this with the temp variable, is this correct?:
    PROCEDURE store_blob ( new_val BLOB ) IS
    BEGIN
    DBMS_LOB.CREATETEMPORARY(new_blob_temp,TRUE, DBMS_LOB.SESSION);
    -- fill with data
    DBMS_LOB.COPY (new_blob_temp,new_val,DBMS_LOB.GETLENGTH(new_val),1,1);
    END store_blob ;
    Because of the design of the application I have to use the AFTER trigger to store the new value so I must find a solution for this type of fields.
    Sorry for the size of the text and also for my english.
    Thanks in advance

    SQL> create or replace trigger trg1 after insert on test_blob for each row
      2  begin
      3  insert into test_blob2 values (:new.a);
      4  end;
      5  /
    Trigger created.
    SQL> insert into test_blob values ('123456789');
    1 row created.
    SQL> desc test_blob;
    Name                                      Null?    Type
    A                                                  BLOB
    SQL> desc test_blob2
    Name                                      Null?    Type
    A                                                  BLOB
    SQL>
    SQL> select dbms_lob.getlength(a) from  test_blob2;
    DBMS_LOB.GETLENGTH(A)
                        5

  • Its urgent regarding Blob field

    I have a stored proc trying to retrieve blob field(a binary file) from a
    View(in schema1) in oracle10g. After retrieving I am sending it to another
    databsase(schema2) through a dblink which is in oracle9i. I am using TOAD for
    this. My code is
    Insert into [email protected]
    Select VPF.P_ID AS PET_ID,
    DBMS_LOB.SUBSTR(VPF.PDF_FILE, 4000, 1) AS PET_FILE
    FROM V_PDF_FILES VPF, [email protected]
    I am unable to insert this. I am getting an error related to BLOB Field. My
    question is, the DBMS_LOB package which I have used is correct or not to
    retrieve? If yes, then is it compatible to send the BLOB from Oracle 10g to
    Oracle9i? What are the limitations for this.? How can I resolve this. Your
    response will be greatly appreciated. If you need more information then let me know.
    Thanks in advance.

    Go to SE11, ur table name and click on change ..now go to Utilities->Table maintenance Generator ,
    there click on the single screen,it will take u to the screen code and then u have to click on button Layout(for screen) ..
    here double cllick on the field label for which u want long text to be displayed,double clicking will open up Attribute window for tht field ,here in the Dict Tab u can see one option named Modify, give value as 3 there (fro long text)..
    now it wil take long text of the field once saved n activated.
    amit

  • Reading BLOB Fields

    Experts -
    Is there any way that we can read the data from BLOB fields of  data base table column in Endeca 3.0 ?
    Do we have some direct readers for BLOB  fields ? OR  point # 2 below  is the correct way in Endeca ?
    Some details I could collect from search/google are below :
    http://docs.oracle.com/cd/E29585_01/DeveloperStudio.61x/DevStudioHelp.pdf Says that directly CLOB / BLOBs are not supported by ENDECA
    https://forums.oracle.com/thread/2426178 - Says a replacement for reading BLOB sources ' Oracle Endeca Advanced JDBC Column Handler 6.1.2 for Generic Platform'
    Any help/pointers is highly appreciated.
    Thank you,
    Ranish

    I see no reason why you shouldn't be able to bring a BLOB field into Endeca but I think the real question is what is the data and what are you trying to do with it?
    If it's some kind of object (say, a serialized profile object about an account), wouldn't it make sense to de-serialize it and add some attribution to the Endeca record?  If it's something else, like say an image file, you could probably hack something together to show it on a details page but bringing it in to the index would provide zero value over just having it somewhere else (like a web server).  When I say no value in Endeca for an image, I mean, you can't search on it, you can't navigate on it, maybe you could display it (though you would create a lot of un-necessary work for yourself).
    Probably need more detail here.  Also, an additional note is that both links you include reference products and utilities that are part of the Oracle Endeca Commerce stack, not Oracle Endeca Information Discovery.
    Patrick Rafferty
    http://branchbird.com/blog/category/oeid/

  • Serv. Desk: Action: send an email only when a value in a field has changed

    Hello,
    In Soution Manager 4.0, Sevice Desk, I would like to create an action which creates an email only when a value of a certain field has changed.
    - only in change mode relevant
    - only when a value of one field has changed (e.g. Message Processort has changed from Buss. Partner 4 to 5. Than a mail should be sent to BP 5).
    - it should only send this kind of email when the field value has changed in change mode. In other words: it should not sent the email e.g. when the status has changed.
    I tried all kinds of things but I do not know on how to define the COnditions for an Action, so I can compare e.g.
    if <old value> <> <new value>
    Any ideas or experience on how to implement this without major modifications ?
    Thanks
    Christian

    Hi Christian,
    check out my question on SDN.
    Email on Status Change
    it has details on how to send an email when the status changes. I believe you are going to have to do something like this for each of the fields you want to create an Action Starting Condition for.
    regards,
    Jason

  • How to Get a BLOB Field from JDBC Coding

    Hi,
    I have written the JDBC Code to get the field values from the Table.
    There is a BLOB field in that table.
    How to get the BLOB ? What is the return type we should use.
    If it is Varchar then we can use rs.getString().
    If it is BLOB then what is the return type?
    Thanks in Advance

    Blob.
    You know, people like you really give me the urge to print out several hundred pages of Java API and smack them on their heads.

  • With a contract number, how to know the total PO release value against it?

    Usually one contract corresponds to multiple PO records, now we know the contract number, then how to know the total PO release value against this contract.  In other word, we would like to know the total release value of all the POs with the same contract number.  To just input the contract number in EKPO table? but then look for which field in this table to add these PO release values up?
    We will give you reward points!
    Thanks!

    hi Mohammad,
    By following your instruction, input the contract number 4800000112 into Document number field, then hit Enter, get the following (only copy two records here for example), but kind of a mess.  Could you let us know which one is the PO release value for this contract?
    Contract   Type Vendor     Name                                 PGp Agmt. date
      Item  Material           Short text                               Mat. group
      D I A Plnt SLoc                 Targ.qty. Un       Net price  Curr.   per Un
    4800000112 WK   2000012012 GULF INTERSTATE FIELD SERVICES       QBH 06/20/2006
    Agreement start06/20/2006 Agreement end 12/31/2007
    Tgt. val.        1,000,000.00  USD   Open          1,000,000.00 USD   100.00 %
      00001                    Inspection Svcs, Construction            R3VNI
      L   U                                  0  UL            0.00  USD       1 EA
      00002                    Chief Inspector                          R3VNI
      L   U                                  0  DAY         390.00  USD       1 DAY

  • Contract Release Value is not updated with Confirmation or Invoice value

    The release value for a contract in SRM EBP shows the value of purchase orders created using that contract.  It does not take into account confirmation and/or invoice values.
    For example I create a PO for 10 items at £100/each using Contract ABC.  The total value of the PO is £1000 and the release value contract ABC would be £1000.  If I then only confirm and invoice 5 items (£500) for the PO, the release value of contract ABC stays at £1000 even though I would expect it to update to £500
    Therefore the release value of the contract could be incorrectly overstated if purchase orders are created against the contract but not actually invoiced/confirmed for their total value.
    Please could you confirm the correct functionality and how I could find out the the true invoice value of purchases made using a contract?

    Hi
    <u>Which SRM and R/3 versions are you using ?</u>
    <b>Meanwhile, please go through the following SAP OSS Notes, which will help in this case -></b>
    Note 622045 Net value in release overview of contract is incorrect
    Note 493519 Release quantities are not updated
    Note 1108322 BBP_CONTRACT_CHECK wrong calculation of values
    Note 1102886 Contracts: Lesser Field length for Target Value
    Note 1082548 Check of Released quantity and released value in contract
    Note 656181 Release synchronization of releases on services
    Note 874920 Currency not allowed to be changed for a 'Released' Contract
    Note 703771 Resetting release values during purchase order item deletion
    Note 643823 BLAREL: Incorrect values in service segment
    Note 519879 BBP_CTR_MAIN: No message when values in Contract are reset
    Note 520734 Target value not converted if currency is changed
    Note 528897 Documents not displayed in contract release order overview
    Note 430373 BBP_CON_MNT: No releases available
    Note 491993 Entry of contracts with target values
    Note 437491 Purchase contract: Incorrect update of the call-off values
    Note 406799 BBP_CON_MNT: Fields after contract release ready for input
    Note 398168 Purchase contract: Target value is not changed
    <b>Do let me know.</b>
    Regards
    - Atul

  • Oracle error ORA-01461when trying to insert into an ORACLE BLOB field

    I am getting Oracle error ‘ORA-01461: can bind a LONG value only  for insert into a LONG column' when trying to insert into an ORACLE BLOB field. The error occurs when trying to insert a large BLOB (JPG), but does not occur when inserting a small (<1K) picture BLOB.(JPG). Any ideas?
    BTW, when using a SQL Server datasource using the same code.... everything works with no problems.
    ORACLE version is 11.2.0.1
    The ORACLE datasource is JDBC using Oracle's JDBC driver ojdbc6.jar v11.2.0.1 (I also have tried ojdbc5.jar v11.2.0.1; ojdbc5.jar v11.2.0.4; and ojdbc6.jar v11.2.0.4 with the same error result.)
    Here is my code:
    <cfset file_mime = Lcase(Right(postedXMLRoot.objname.XmlText, 3))>
    <cfif file_mime EQ 'jpg'><cfset file_mime = 'jpeg'></cfif>
    <cfset file_mime = 'data:image/' & file_mime & ';base64,'>
    <cfset image64 = ImageReadBase64("#file_mime##postedXMLRoot.objbase64.XmlText#")>
    <cfset ramfile = "ram://" & postedXMLRoot.objname.XmlText>
    <cfimage action="write" source="#image64#" destination="#ramfile#" overwrite="true">
    <cffile action="readbinary" file="#ramfile#" variable="image_bin">
    <cffile action="delete" file="#ramfile#">
    <cfquery name="InsertImage" datasource="#datasource#">
    INSERT INTO test_images
    image_blob
    SELECT
    <cfqueryparam value="#image_bin#" cfsqltype="CF_SQL_BLOB">
    FROM          dual
    </cfquery>

    Can't you use "alter index <shema.spatial_index_name> rebuild ONLINE" ? Thanks. I could switch to "rebuild ONLINE" and see if that helps. Are there any potential adverse effects going forward, e.g. significantly longer rebuild than not using the ONLINE keyword, etc? Also wondering if spatial index operations (index type = DOMAIN) obey all the typical things you'd expect with "regular" indexes, e.g. B-TREE, etc.

Maybe you are looking for

  • My ipod touch 5th gen wont show up in i-tunes. windows 8

    when I connect my ipod touch 5th gen to my computer, it wont show up in I-tunes for me to load download or sync. 1 time out of ten it might come up in i tunes. but even when it does, on the summary screen in i tunes it still says ' please connect you

  • IMac turned off suddenly, won't boot from hard drive/CD drive

    Hi guys. Here is what I have: 27" iMac with: Core i5 2.7 4GB RAM Mountain Lion Win7 on Bootcamp Lion is installed, but I have the Snow Leopard install disc. The system had just been recently reformatted so there wasn't really much on the computer its

  • How to specify XML declaration in an XML Variable

    I had posted this question in the Flex Builder discussion, but I am not sure if that was the right board, so posting it again here: I need to set the XML declaration for my XML variable as follows: var employees:XML = <?xml version="1.0" encoding="ut

  • Spot colors not being saved.

    In CS6 I have been having random situations where the spot color channels are not saved when saving a .psd, regardless of the settings in the save dialog box. Any idea of why this might be happening? I've even had the program dump the spot colors fro

  • In which system field double click feild will stored

    hi when you double click in interactive report, in which system field will store that value Message was edited by:         sudhakara reddy