BLOB, BFILE problems

We have tried different methods to get these data types to work in a PO8 environment. If we use the Oracle Navigator we can store and read blob data. When we try the same using JDBC 2.0 driver we can not get even the insert to work correctly. Has anyone ever been successful in getting it work. The samples of codes in many books don't seem to have been tested either because they don't work either!
For example, using the BFILE option (example given by Steve Bobowski)gave us a FILEOPEN exception ORA error 22285 (No directory exists or cannot open file). The directory and the file does exist and the user has the required permissions!
Any help?

Chapter 7 in the Oracle Call Interface Programmer's Guide discusses [LOB and BFILE operations|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14250/oci07lob.htm#g452677]. Given that you are posting here, I assume you are interested in using the OCI interface and that you are familiar with the basics of OCI programming. If not, you'll want to read the other chapters in the OCI Programmer's Guide.
Justin

Similar Messages

  • Blob (bfile)+ ole2

    hello gurus
    i would like to know how is possible within Oracle Forms (i am still using 6i) to retrieve a MS office document stored in an oracle DB and showing it using ole2 automation.
    I miss just the step of retrieving from DB and loading it into memory or somewhere on the client filesystem, so let it be opened with the right MS office application (chosen with ole2)
    My actual idea is to create a block based on the table that stores the blob (bfile) column, but i don't know how to store the blob (bfile) object in the forms application.. there is a particular object to use? or i must just load the key (or rowid) and then requering the table using it? and after loading the blob (bfile) from table, how can i convert it to be usable for ole2?
    thanks in advance!
    claudio

    Chapter 7 in the Oracle Call Interface Programmer's Guide discusses [LOB and BFILE operations|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14250/oci07lob.htm#g452677]. Given that you are posting here, I assume you are interested in using the OCI interface and that you are familiar with the basics of OCI programming. If not, you'll want to read the other chapters in the OCI Programmer's Guide.
    Justin

  • Download from BFILE problem

    Hello,
    I have the following problem:
    1. I can upload PDF files into BFILE(s) - in the DATA_PUMP_DIR (dba_directories table)
    2. The uploaded file can be opened/viewed with Adobe Acrobat Reader.
    3. I use a stored procedure do download the PDF files from my browser.
    4. the download works ok but the file can no longer be opened/viewed using Adobe Acrobat Reader.
    5. I did a hex compare of 2 pdf files (the uploaded file and the downloaded file) and I think it is a CR vs CRLF conversion problem.
    I am using Oracle 10g XE on a Linux box and Windows as a client. The upload/download is part of a APEX application.
    This is the code used to download the BFILE:
    Note: v_mime is set to 'application/pdf'.
            x_bfile := BFILENAME ('DATA_PUMP_DIR', p_file);
            DBMS_LOB.fileopen (x_bfile, DBMS_LOB.LOB_READONLY);
            -- set up HTTP header
            -- use an NVL around the mime type and
            -- if it is a null set it to application/octect
            -- application/octect may launch a download window from windows
            owa_util.mime_header( nvl(v_mime,'application/octet'), FALSE );
            -- the filename will be used by the browser if the users does a save as
            htp.p('Content-Disposition:  attachment; filename="'||substr(v_file_name,instr(v_file_name,'/')+1)|| '"');
            -- close the headers
            owa_util.http_header_close;
            BEGIN
                LOOP
                    DBMS_LOB.READ (x_bfile,
                                   n_size,
                                   n_pos,
                                   x_buffer);
                    HTP.prn (UTL_RAW.cast_to_varchar2 (x_buffer));
                    -- increment number of bytes read
                    n_pos := n_pos + n_size;
                END LOOP;
            EXCEPTION
                WHEN NO_DATA_FOUND THEN
                    NULL;
            END;Any suggestions?
    Thanks,
    Catalin Florean.

    You could try using wpg_docload.download_file instead of htp.prn.
    Here is part of the procedure I use for downloading MP3 files from BFILES:
                    owa_util.http_header_close;
                    dbms_lob.createTemporary(TBlob, true);  
                    dbms_lob.open(Lob_loc, dbms_lob.file_readonly);
                    dbms_lob.loadfromfile( TBlob, Lob_loc, dbms_lob.getlength(Lob_loc) );
                    dbms_lob.fileclose(Lob_loc);
                    -- download the BLOB           
                    wpg_docload.download_file( TBlob );    
                    dbms_lob.freeTemporary( TBlob );You would replace my Lob_loc variable with your x_bfile.

  • BFILE Problem

    Hello,
    The problem that i have is that i want to insert a file residing in the network into the oracle database into a blob field and again read it from the database and show it ie either insert it into a file directly and then open it using the correct editor or open it directly. I am using java along with it but i am basically stuck on the database side.
    I am sending the code which i have written till date
    i basically need to know
    1)the syntax i am using to interact with the database is right ie where is the error in the code
    2)provided that is ok whether my overall code is on the right track.
    After line control 10
    The error message i am getting:
    java.sql.SQL Exception:ORA-22288:file operation fileopen failed
    LFI:00108:open expect the file[map][gif] to exist
    ORA-0615:at"SYS.DBMS_LOB",line 370
    ORA-0615:at line 1
    My developopment enviornment is JDeveloper3.0 as this code is having problems compiling in JDK as Jdeveloper overides a few of the jdk classes.
    =========================================================================
    My table structure
    CREATE TABLE DOC_MAS(
    DOC_MAS_SR_NO NUMBER(10),
    PROJECT_NAME VARCHAR2(30),
    MODULE_NO NUMBER(10),
    DOC_NAME VARCHAR2(10),
    DOC_TYPE VARCHAR2(10),
    VERSION NUMBER(10));
    CREATE SEQUENCE SEQ_DOC_MAS START WITH 1 INCREMENT BY 1;
    CREATE SEQUENCE SEQ_DOC_DETAIL START WITH 1 INCREMENT BY 1;
    CREATE TABLE DOC_DETAIL(
    DOC_DETAIL_SR_NO NUMBER(10),
    DOC_MAS_SR_NO NUMBER(10),
    DATE_OF_INSERT DATE,
    ACTUAL_DOC BFILE,
    COMMENTS VARCHAR2(500));
    ===============================================================================
    My connection code:
    public class ConnectionParams {
    // The machine on which the database resides
    //public final static String s_hostName = "insn110a.in.oracle.com";
    public final static String s_hostName = "192.168.1.1";
    // The TNS listener port
    public final static String s_portNumber = "1521";
    // The database name (SID)
    //public final static String s_databaseSID = "otndb";
    public final static String s_databaseSID = "orcl";
    // The database User ID
    public final static String s_userName = "scott";
    // The database user password
    public final static String s_password = "tiger";
    ========================================================================================
    import java.io.*;
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.driver.*;
    import java.util.*;
    import java.util.Date;
    //import java.math.BigDecimal;
    public class Sample3
    int size;
    Connection m_connection; //Database Connection Object
    String p_doc_name=null;
    String s_blobvariable = p_doc_name;
    String file_path = null;
    byte b[];
    String l_dirPath;
    public Sample3()
    dbConnection();
    public static void main(String[] args)
    Sample3 lobs = new Sample3();
    // lobs.dbConnection();
    lobs.readFileNameExt();
    /*This class is for creation of connection =========================================*/
    public void dbConnection() {
    try {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    String l_dbConnectString =
    "(DESCRIPTION=(ADDRESS=(HOST="+ConnectionParams.s_hostName+")"+
    "(PROTOCOL=tcp)(PORT="+ConnectionParams.s_portNumber+"))"+
    "(CONNECT_DATA=(SID="+ConnectionParams.s_databaseSID+")))";
    m_connection = DriverManager.getConnection(
    "jdbc:oracle:thin:@"+l_dbConnectString,
    ConnectionParams.s_userName, ConnectionParams.s_password);
    m_connection.setAutoCommit(false);
    System.out.println("Connection Successful");
    Thread.sleep(3000);
    } catch(Exception ex){ //Trap SQL errors
    System.out.println("Error in Connecting to the Database "+ex.toString());
    /*========================================================================================
    File inserting section of the code
    // THIS class gets the input from the file dialog box it gets the file path,projectName and the module no
    //public void readFileNameExt(String p_doc_path,String p_module_no,String p_project_name)
    public void readFileNameExt()
    String p_doc_path = "c:/warea/Mehul2/map.gif";
    int p_module_no = 10;
    String p_project_name = "Finserve";
    String p_doc_type= null;
    String p_version = null;
    StringTokenizer strtkn = new StringTokenizer(p_doc_path,"/");
    while(strtkn.hasMoreTokens())
    p_doc_name =strtkn.nextToken();
    System.out.println("The file name is" +p_doc_name);
    s_blobvariable = p_doc_path;
    StringTokenizer strtoken = new StringTokenizer(p_doc_name,".");
    while(strtoken.hasMoreTokens())
    p_doc_type =strtoken.nextToken();
    try{
    System.out.println("The file Type is"+p_doc_type);
    insertDocMas(p_doc_path,p_doc_name,p_doc_type,p_project_name,p_module_no);
    Thread.sleep(10000);
    }catch (Exception e){}
    }//end of method
    //============================================== this class is for inserting the doc_mas details in teh table along with version checking
    public void insertDocMas(String p_doc_path,String p_doc_name,String p_doc_type,String p_project_name,int p_module_no){
    int p_version = -1;
    int p_doc_mas_sr_no = -1;
    // String verision=null;
    int verision;
    String s = null;
    try{
    Statement l_stmt = m_connection.createStatement();
    ResultSet l_version_details = l_stmt.executeQuery("SELECT MAX(VERSION) FROM DOC_MAS WHERE DOC_NAME = '"+p_doc_name+"'");
    if (l_version_details.next())
    { System.out.println("The Control 1");
    verision = l_version_details.getInt(1);
    System.out.println("The Control 2 : "+verision);
    verision = verision +1;
    else {
    verision = 1;
    System.out.println("The Control 3");
    p_version = verision;
    // System.out.println("The value of p_version" + p_version);
    l_version_details.close();
    l_stmt.close();
    Thread.sleep(4000);
    }catch(Exception e){
    System.out.println("Exception has occured at the time of insert"+e);
    System.out.println("The value of p_version" + p_version);
    /* try{
    Statement stmt = m_connection.createStatement();
    ResultSet rset = stmt.executeQuery("select DEPTNO,DNAME,LOC from DEPT");
    while(rset.next()){
    BigDecimal deptno = rset.getBigDecimal(1,2);
    String dname = rset.getString(2);
    // Timestamp hiredate = rset.getTimestamp(3);
    String loc = rset.getString(3);
    System.out.println(deptno+" "+dname+" "+loc);
    Thread.sleep(50000);
    }catch(Exception e){System.out.println(e);}
    try{
    Statement l_stmt = m_connection.createStatement();
    ResultSet l_seq_details = l_stmt.executeQuery("SELECT SEQ_DOC_MAS.NEXTVAL FROM DUAL");
    if (l_seq_details.next())
    p_doc_mas_sr_no = l_seq_details.getInt(1);
    System.out.println("The Control AA");
    System.out.println("The value of p_doc_mas_sr_no" + p_doc_mas_sr_no);
    l_seq_details.close();
    l_stmt.close();
    Thread.sleep(4000);
    }catch(Exception e){
    System.out.println("Exception has occured at the time of selecting the current sequence number"+e);
    try {
    System.out.println("Creating rows in DOC_MAS.. ");
    System.out.println("The Control VV");
    PreparedStatement l_pstmt = m_connection.prepareStatement("insert into DOC_MAS(DOC_MAS_SR_NO,PROJECT_NAME,MODULE_NO,DOC_NAME,DOC_TYPE,VERSION) values(?,?,?,?,?,?)");//SEQ_DOC_MAS.nextval
    l_pstmt.setInt(1,p_doc_mas_sr_no);//"SEQ_DOC_DETAIL.NEXTVAL"
    l_pstmt.setString(2,p_project_name);
    l_pstmt.setInt(3,p_module_no);
    l_pstmt.setString(4,p_doc_name);
    l_pstmt.setString(5,p_doc_type);
    l_pstmt.setInt(6,p_version);
    l_pstmt.executeUpdate(); // Execute SQL statement
    l_pstmt.close();
    System.out.println("The Control 3");
    // Close statement
    //Thread.sleep(20000);
    }catch(Exception e){
    System.out.println("Exception has occured at the time of insert11"+e);
    try{System.out.println("The Control 4");
    Statement l_statement = m_connection.createStatement();
    ResultSet l_doc_mas_sr_no = l_statement.executeQuery(
    "SELECT max(DOC_MAS_SR_NO) FROM DOC_MAS "+
    "WHERE DOC_NAME = '"+p_doc_name+"' ");//FOR UPDATE
    if (l_doc_mas_sr_no.next())
    p_doc_mas_sr_no = l_doc_mas_sr_no.getInt(1);
    l_doc_mas_sr_no.close();
    l_statement.close();
    System.out.println("The Control 5");
    //Thread.sleep(10000);
    }catch(Exception e){
    System.out.println("Exception has occured at the time of insert");
    loadSamples(p_version,p_doc_path,p_project_name,p_doc_mas_sr_no,p_doc_name,p_doc_type);
    }//Method insertDocMas() closing here
    /*This class is for loading the data into the database==================================*/
    public void loadSamples(int p_version, String p_doc_path,String p_project_name,int p_doc_mas_sr_no,String p_doc_name,String p_doc_type) {
    int p_doc_detail_sr_no = -1;
    //Date p_sysdate = new Date() ;
    try{
    Statement l_stmt = m_connection.createStatement();
    ResultSet l_seq_doc_details = l_stmt.executeQuery("SELECT SEQ_DOC_DETAIL.NEXTVAL FROM DUAL");
    if (l_seq_doc_details.next())
    p_doc_detail_sr_no = l_seq_doc_details.getInt(1);
    System.out.println("The Control AA");
    System.out.println("The value of p_doc_detail_sr_no" + p_doc_detail_sr_no);
    l_seq_doc_details.close();
    l_stmt.close();
    Thread.sleep(4000);
    }catch(Exception e){
    System.out.println("Exception has occured at the time of selecting the current sequence number"+e);
    try {System.out.println("The Control 6");
    java.sql.Date current_date = new java.sql.Date(System.currentTimeMillis());
    System.out.println("Creating row for actual-doc in DOC_DETAILS.. ");
    //PreparedStatement l_pstmt = m_connection.prepareStatement("insert into DOC_DETAIL(DOC_DETAIL_SR_NO,DOC_MAS_SR_NO,DATE_OF_INSERT,ACTUAL_DOC)values(?,?,'"+current_date+"', empty_blob() )");
    PreparedStatement l_pstmt = m_connection.prepareStatement("insert into DOC_DETAIL(DOC_DETAIL_SR_NO,DOC_MAS_SR_NO,DATE_OF_INSERT)values(?,?,?)");
    l_pstmt.setInt(1,p_doc_detail_sr_no);
    l_pstmt.setInt(2,p_doc_mas_sr_no);
    l_pstmt.setDate(3,current_date);
    System.out.println("The Control 6AA");
    l_pstmt.execute(); // Execute SQL statement
    l_pstmt.close(); // Close statement
    System.out.println("Created.\nLoading <map.gif> into BLOB column for doc_detail...");
    System.out.println("The Control 7");
    // Retrieve the row just inserted, and lock it for insertion of the
    }catch(Exception e){
    System.out.println("Exception has occured at the time of inserting blob locators"+e);
    try {
    System.out.println("The Control 8");
    l_dirPath = p_doc_path ;
    PreparedStatement l_pstmt = m_connection.prepareStatement(
    "CREATE OR REPLACE DIRECTORY BFILEDIR AS '" + l_dirPath + "' ");
    l_pstmt.execute();
    l_pstmt.close();
    // Execute the prepared SQL Statement
    } catch (Exception ex)
    { // Trap SQL errors
    System.out.println("Error loading sample files ");
    System.out.println("\n"+ex.toString());
    System.out.println("The Control 8AA");
    try{
    // Insert the Image as a BFILE Column
    // String abc = new String("INSERT INTO DOC_DETAIL(ACTUAL_DOC)VALUES(BFILENAME('BFILEDIR2','" + p_doc_name + "')) WHERE D0C_MAS_SR_NO = '" + p_doc_mas_sr_no + "';");
    //System.out.println(abc);
    //l_pstmt.executeQuery("insert into DOC_DETAIL(ACTUAL_DOC)values(BFILENAME('BFILEDIR','" + p_doc_name + "')) where D0C_MAS_SR_NO = '" + p_doc_mas_sr_no + "';");
    String abc = new String("update DOC_DETAIL SET ACTUAL_DOC = BFILENAME('BFILEDIR','" + p_doc_name + "') where D0C_MAS_SR_NO = '"+p_doc_mas_sr_no+"' ");
    System.out.println(abc);
    PreparedStatement l_pstmt = m_connection.prepareStatement("update DOC_DETAIL SET ACTUAL_DOC = BFILENAME('BFILEDIR','" + p_doc_name + "') where DOC_MAS_SR_NO = '"+p_doc_mas_sr_no+"' ");
    l_pstmt.executeQuery();
    l_pstmt.close(); // Close the prepared Statement
    drawBLOB(p_version,p_doc_mas_sr_no,p_project_name,p_doc_name, p_doc_type);
    System.out.println("The Control 9");
    } catch (Exception ex)
    { // Trap SQL errors
    System.out.println("Error loading sample files ");
    System.out.println("\n"+ex.toString());
    }//Method closes here
    * Retrieve the BLOB data from input BLOB column into a local file,
    * and draws the image. The file type needs to be added here
    public void drawBLOB(int p_version,int p_doc_mas_sr_no,String p_project_name, String p_doc_name,String p_doc_type) {
    //String fileType this should be passed at some point to ensure that th e file gets the right extension
    try { System.out.println("The Control 10");
    Statement l_stmt = m_connection.createStatement();
    // Execute the Query and get BFILE Locator as a result set
    ResultSet l_rset = l_stmt.executeQuery("Select ACTUAL_DOC from DOC_DETAIL WHERE DOC_MAS_SR_NO= '"+p_doc_mas_sr_no+"' ");
    //Note : Using Oracle Extension oracle.sql.BFILE to get BFILE Locator
    oracle.sql.BFILE l_bfile = null;
    // Loop through the Result Set
    while(l_rset.next()) {
    l_bfile = ((OracleResultSet)l_rset).getBFILE(1); // Get the BFILE Locator
    System.out.println("Retrieved BFILE Locator..");
    System.out.println("l_bfile :"+l_bfile);
    l_rset.close(); // Close the ResultSet
    l_stmt.close(); // Close the Statement
    // Open the file with openFile Method of oracle.sql.BFILE class
    l_bfile.openFile();
    // Open the Input Binary Stream with getBinaryStream method of
    // oracle.sql.BFILE class
    InputStream f = l_bfile.getBinaryStream();
    System.out.println("Opened Binary Stream ...");
    size =f.available();
    System.out.println("Actual Size:"+size+"Bytes");
    int n = size;
    int x=0;
    System.out.println("First"+n+"bytes of the file one can read at a time");
    b = new byte[size];
    System.out.println("printing bytes"+b);
    char ch=' ';
    while(x<size)
    ch=(char)f.read();
    b[x]=(byte)ch;
    //str+=ch;
    x++;
    System.out.println("The Control 11");
    // file_path = "c:/warea/mehul/Project/"+p_project_name+"/"+p_doc_name;
    directoryMap( p_version, p_project_name, p_doc_name);//This method is called here
    OutputStream fout = new FileOutputStream(file_path);
    for(int i=0;i<b.length;i +=2)
    //out.println(b);
    fout.write(b[i]);
    System.out.println("The Control 12");
    drawMap(file_path,p_doc_name,p_doc_type);
    } catch (Exception ex) { // Trap SQL and IO errors
    System.out.println("Error in retrieving and drawing map for selected airport");
    System.out.println("\n"+ex.toString());
    * Create a label from the image filepassed, add the label to the image area
    This part will have to be modified majorly
    public void drawMap(String file_path, String p_doc_name,String p_doc_type)
    //Refer to SIRExtOpen.java
    System.out.println("The Control 13");
    Runtime r = Runtime.getRuntime();
    Process p = null;
    if (p_doc_type.equals("html")&#0124; &#0124;p_doc_type.equals("htm"))
    try{
    p = r.exec( "C:\\Program Files\\Internet Explorer\\Iexplore.EXE " +file_path);
    //repaint();
    p.waitFor();
    catch(Exception ex)
    ex.printStackTrace();
    System.out.println(ex);
    System.out.println(ex.getMessage());
    if(p_doc_type.equals("txt")&#0124; &#0124; p_doc_type.equals("sql")&#0124; &#0124; p_doc_type.equals("java"))
    try
    p = r.exec( "C:\\WINDOWS\\notepad.EXE " + p_doc_name); p.waitFor();
    catch(Exception ex)
    ex.printStackTrace();
    System.out.println(ex);
    System.out.println(ex.getMessage());
    } // end of txt , sql , java if
    if(p_doc_type.equals("xls"))
    try
    p = r.exec( "C:\\Program Files\\Microsoft Office\\Office\\excel.EXE " +file_path);
    p.waitFor();
    catch(Exception ex)
    ex.printStackTrace();
    System.out.println(ex);
    System.out.println(ex.getMessage());
    } // end of xls if
    if(p_doc_type.equals("fmb"))
    try
    p = r.exec( "C:\\Program Files\\Accessories\\wordpad.exe " + file_path);p.waitFor();
    catch(Exception ex)
    ex.printStackTrace();
    System.out.println(ex);
    System.out.println(ex.getMessage());
    } // end of fmb if
    if(p_doc_type.equals("doc"))
    try
    p = r.exec( "C:\\Program Files\\Accessories\\wordpad.exe " + file_path);p.waitFor();
    catch(Exception ex)
    ex.printStackTrace();
    System.out.println(ex);
    System.out.println(ex.getMessage());
    } // end of doc if
    if(p_doc_type.equals("mpp"))
    try
    p = r.exec( "C:\\Program Files\\Accessories\\wordpad.exe " + file_path);p.waitFor();
    catch(Exception ex)
    ex.printStackTrace();
    System.out.println(ex);
    System.out.println(ex.getMessage());
    } // end of mpp if
    //Here you can write a statement for deleting the file in the root directory once the file is opened using any editor
    }//end of method
    * This method is called when a row is selected from the combo.
    * It checks if there exists data in DOC_DETAIL for the selected
    * file. If there exists data, it calls drawBLOB and writeCLOB to
    * display the data
    /*public void fileSelected(String p_doc_mas_sr_no,String p_doc_name,String p_doc_type) {
    try {
    System.out.println("Retrieving LOB details for selected file..");
    // Create a SQL statement
    Statement l_stmt = m_connection.createStatement();
    // Query DOC_DETAILS for the selected file
    java.sql.ResultSet l_lobDetails = l_stmt.executeQuery(
    "SELECT ACTUAL_DOC FROM DOC_DETAILS "+
    "WHERE DOC_MAS_SR_NO='"+p_doc_mas_sr_no+"'");
    // Check if LOB columns exist
    if (l_lobDetails.next()) {
    // LOB details exist
    // Display airport map and suggestion book (LOB details)
    drawBLOB(l_lobDetails.getBlob(1),p_doc_name,p_doc_type);
    //lobs.drawBLOB(((OracleResultSet)l_lobDetails).getBLOB(1),p_doc_name,p_doc_type);
    //Should this be like this
    System.out.println("Done retrieving and displaying LOB details");
    } else {
    // No LOB details
    // m_GUI.m_loadButton.setEnabled(true);
    //TO BE CHECKED OUT LATER m_loadButton This is a button in the form
    System.out.println("No airport map and suggestion book exist for selected airport");
    System.out.println("\nPress <Load Sample3 Files> to load LOB details");
    l_lobDetails.close();
    l_stmt.close();
    } catch (Exception ex) { // Trap SQL errors
    System.out.println("Error retrieving LOB Details for the selected airport");
    System.out.println(ex.toString());
    public void directoryMap(int p_version,String p_project_name,String p_doc_name) {//start of the method
    System.out.println("The Control 14");
    if (p_version==1)
    File f = new File("c:/warea/mehul/Project/"+p_project_name+"/"+p_version);
    if(f.exists())
    file_path = "c:/warea/mehul/Project/"+p_project_name+"/"+p_version+"/"+p_doc_name;
    else
    File f1 = new File("c:/warea/mehul/Project/"+p_project_name+"/"+p_version);
    file_path = "c:/warea/mehul/Project/"+p_project_name+"/"+p_version+"/"+p_doc_name;
    }//end of inner else
    }//end of else
    else if(p_version==2)
    File f = new File("c:/warea/mehul/Project/"+p_project_name+"/"+p_version);
    if(f.exists())
    file_path = "c:/warea/mehul/Project/"+p_project_name+"/"+p_version+"/"+p_doc_name;
    else
    File f1 = new File("c:/warea/mehul/Project/"+p_project_name+"/"+p_version);
    file_path = "c:/warea/mehul/Project/"+p_project_name+"/"+p_version+"/"+p_doc_name;
    }//end of inner else
    }//end of else
    else if(p_version==3)
    File f = new File("c:/warea/mehul/Project/"+p_project_name+"/"+p_version);
    if(f.exists())
    file_path = "c:/warea/mehul/Project/"+p_project_name+"/"+p_version+"/"+p_doc_name;
    else{
    File f1 = new File("c:/warea/mehul/Project/"+p_project_name+"/"+p_version);
    file_path = "c:/warea/mehul/Project/"+p_project_name+"/"+p_version+"/"+p_doc_name;
    }//end of inner else
    }//end of outer else
    else
    System.out.println("System has gone into 4th version");
    }//end of method
    }//end of class
    null

    Hi
    Have you found a workaround for this problem? im having a similiar problem and am interested in its solution.....

  • Blob mapping problem

    Hi,
    I have some problems with blob mapping.
    I map a Serializable field in a BLOB column (in MySQL 4.1 w/ latest Kodo
    version) using following metadata:
    <field name="metadata" persistence-modifier="persistent">
    <extension vendor-name="kodo" key="type" value="Object"/>
    <!-- extension vendor-name="kodo" key="jdbc-size" value="-1"/ -->
    </field>
    <field name="metadata">
    <jdbc-field-map type="blob" column="METADATA"/>
    </field>
    Making the object persistent works well. The generated SQL is
    INSERT INTO ATTRIBUTE_TYPE (METADATA, NAME, POID)
    VALUES (?, ?, ?)
    [params=(InputStream) java.io.ByteArrayInputStream@1c9b9ca, (String)
    IntegerNew3, (long) 250] [reused=0]
    Problems occur when I try to load the object. I get a ClassCastException
    (see below). For information:
    - I have saved the blob to my hard disk, and read it using
    ObjectInputStream, and it works fine. So, the object is correctly stored.
    - I have set the field in my Java class to java.lang.Object (instead of
    my class implementing Serializable), and then it works fine too.
    SELECT t0.POID, t0.NAME
    FROM ATTRIBUTE_TYPE t0
    WHERE (t0.NAME = ?)
    [params=(String) IntegerNew3] [reused=0]
    5578 TRACE [main] kodo.jdbc.SQL - <t 4219289, conn 4729123> [15 ms]
    executing prepstmnt 2614099
    SELECT t0.METADATA
    FROM ATTRIBUTE_TYPE t0
    WHERE t0.POID = ?
    [params=(long) 250] [reused=0]
    Exception in thread "main" kodo.util.GeneralException:
    java.lang.ClassCastException: [B
         at kodo.runtime.StateManagerImpl.loadFields(StateManagerImpl.java:3155)
         at kodo.runtime.StateManagerImpl.loadField(StateManagerImpl.java:3227)
         at kodo.runtime.StateManagerImpl.isLoaded(StateManagerImpl.java:1368)
         at
    be.banksys.tams.model.base.AttributeType.jdoGetmetadata(AttributeType.java)
         at
    be.banksys.tams.model.base.AttributeType.getMetadata(AttributeType.java:50)
         at be.banksys.tams.model.base.Essai.main(Essai.java:55)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
    NestedThrowablesStackTrace:
    java.lang.ClassCastException: [B
         at
    be.banksys.tams.model.base.AttributeType.jdoReplaceField(AttributeType.java)
         at kodo.runtime.StateManagerImpl.replaceField(StateManagerImpl.java:3256)
         at
    kodo.runtime.StateManagerImpl.storeObjectField(StateManagerImpl.java:2640)
         at kodo.runtime.StateManagerImpl.storeObject(StateManagerImpl.java:2624)
         at kodo.jdbc.meta.BlobFieldMapping.load(BlobFieldMapping.java:231)
         at
    kodo.jdbc.runtime.JDBCStoreManager.loadMappings(JDBCStoreManager.java:1019)
         at
    kodo.jdbc.runtime.JDBCStoreManager.loadMappings(JDBCStoreManager.java:970)
         at kodo.jdbc.runtime.JDBCStoreManager.load(JDBCStoreManager.java:510)
         at
    kodo.runtime.DelegatingStoreManager.load(DelegatingStoreManager.java:133)
         at kodo.runtime.ROPStoreManager.load(ROPStoreManager.java:79)
         at kodo.runtime.StateManagerImpl.loadFields(StateManagerImpl.java:3128)
         at kodo.runtime.StateManagerImpl.loadField(StateManagerImpl.java:3227)
         at kodo.runtime.StateManagerImpl.isLoaded(StateManagerImpl.java:1368)
         at
    be.banksys.tams.model.base.AttributeType.jdoGetmetadata(AttributeType.java)
         at
    be.banksys.tams.model.base.AttributeType.getMetadata(AttributeType.java:50)
         at be.banksys.tams.model.base.Essai.main(Essai.java:55)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
    Regards,
    J-F

    Patrick Linskey wrote:
    Hi,
    This is a known issue with MySQL, and Kodo 3.3.3 has a workaround for it
    -- set the DBDictionary DriverDeserializesBlobs property to false:
    kodo.jdbc.DBDictionary: DriverDeserializesBlobs=false
    -PatrickDon't take it bad, but then why don't you put it in the MySQL known issues
    in the documentation. It is a pity to waste hours on a known problem.
    J-F

  • Persist document in BLOB column problem

    Hi all,
    I'm having problem with persisting document in BLOB column.
    Using debuger I checked that document.doc contains correctly uploaded file before persist. There are other attributes of document and they are persisted correctly, but when I check blob size in database it size is 1byte which is incorrect.
    After I persist second file, first one get his correct size value, and size of second one is 1byte.
    If I stop weblogic server, second value will never be populated. If I only restart application without restarting server, and then upload third document, size of second one will be corrected.
    Oracle JDeveloper 11g R1 11.1.1.2.0
    Oracle DataBase 10gR2
    Using ADF 11g RC & EJB
    I set id manually.
    Entity Document.java:...
    @Entity
    @NamedQueries({
      @NamedQuery(name = "Document.findAll", query = "select o from Document o")
    public class Document implements Serializable {
        @Id
        private Long id;
        @Lob
        private byte[] doc;
        private String title;
        private String type;
    }Here is persistence.xml:
    <?xml version="1.0" encoding="UTF-8" ?>
    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
                 version="1.0">
      <persistence-unit name="Model">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <jta-data-source>jdbc/FileUDS</jta-data-source>
        <class>fu.model.entity.Document</class>
        <properties>
          <property name="eclipselink.target-server" value="WebLogic_10"/>
          <property name="javax.persistence.jtaDataSource" value="jdbc/FileUDS"/>
        </properties>
      </persistence-unit>
    </persistence>Here is sample project with DDL for document table:[url http://uploading.com/files/52m65757/TestFileUpload.zip]TestFileUpload.zip

    Finest log when it doesn't work:
    [EL Finest]: 2010-09-22 15:01:12.732--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Begin deploying Persistence Unit Model; state Predeployed; factoryCount 1
    [EL Finest]: 2010-09-22 15:01:12.748--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Begin weaver class transformer processing class [fu.model.entity.Dummy].
    [EL Finest]: 2010-09-22 15:01:12.748--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Weaved persistence (PersistenceEntity) [fu.model.entity.Dummy].
    [EL Finest]: 2010-09-22 15:01:12.748--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Weaved change tracking (ChangeTracker) [fu.model.entity.Dummy].
    [EL Finest]: 2010-09-22 15:01:12.748--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Weaved fetch groups (FetchGroupTracker) [fu.model.entity.Dummy].
    [EL Finest]: 2010-09-22 15:01:12.748--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--End weaver class transformer processing class [fu.model.entity.Dummy].
    [EL Finer]: 2010-09-22 15:01:12.794--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Could not initialize Validation Factory. Encountered following exception: java.lang.NoClassDefFoundError: javax/validation/Validation
    [EL Finest]: 2010-09-22 15:01:12.81--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.target-server; value=WebLogic_10; translated value=org.eclipse.persistence.platform.server.wls.WebLogic_10_Platform
    [EL Finest]: 2010-09-22 15:01:12.81--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
    [EL Finest]: 2010-09-22 15:01:12.81--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
    [EL Finest]: 2010-09-22 15:01:12.81--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.target-database; value=Oracle10g; translated value=org.eclipse.persistence.platform.database.oracle.Oracle10Platform
    [EL Finest]: 2010-09-22 15:01:12.826--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=javax.persistence.jtaDataSource; value=jdbc/OracleTextDS
    [EL Finest]: 2010-09-22 15:01:12.841--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.cache.shared.default; value=false; translated value=false
    [EL Finest]: 2010-09-22 15:01:12.841--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.jdbc.native-sql; value=true
    [EL Info]: 2010-09-22 15:01:12.873--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--EclipseLink, version: Eclipse Persistence Services - 1.2.0.v20091016-r5565
    [EL Info]: 2010-09-22 15:01:12.873--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Server: WebLogic Server 10.3.2.0  Tue Oct 20 12:16:15 PDT 2009 1267925
    [EL Config]: 2010-09-22 15:01:12.888--ServerSession(32436700)--Connection(25502890)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--connecting(DatabaseLogin(
         platform=>Oracle10Platform
         user name=> ""
         connector=>JNDIConnector datasource name=>jdbc/OracleTextDS
    [EL Config]: 2010-09-22 15:01:12.951--ServerSession(32436700)--Connection(31684552)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Connected: jdbc:oracle:thin:@itimserver:1521:omnidb
         User: OTEXT
         Database: Oracle  Version: Oracle Database 10g Release 10.2.0.1.0 - Production
         Driver: Oracle JDBC driver  Version: 11.1.0.7.0-Production
    [EL Config]: 2010-09-22 15:01:12.966--ServerSession(32436700)--Connection(13432760)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--connecting(DatabaseLogin(
         platform=>Oracle10Platform
         user name=> ""
         connector=>JNDIConnector datasource name=>jdbc/OracleTextDS
    [EL Config]: 2010-09-22 15:01:12.966--ServerSession(32436700)--Connection(10190221)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Connected: jdbc:oracle:thin:@itimserver:1521:omnidb
         User: OTEXT
         Database: Oracle  Version: Oracle Database 10g Release 10.2.0.1.0 - Production
         Driver: Oracle JDBC driver  Version: 11.1.0.7.0-Production
    [EL Info]: 2010-09-22 15:01:13.576--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--file:/C:/oracle/Middleware/jdeveloper/system11.1.1.2.36.55.36/o.j2ee/drs/TestFileUpload/ModelEJB.jar/-Model login successful
    [EL Finest]: 2010-09-22 15:01:13.591--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--The applicationName for the MBean attached to session [file:/C:/oracle/Middleware/jdeveloper/system11.1.1.2.36.55.36/o.j2ee/drs/TestFileUpload/ModelEJB.jar/-Model] is [TestFileUpload]
    [EL Finest]: 2010-09-22 15:01:13.591--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--The moduleName for the MBean attached to session [file:/C:/oracle/Middleware/jdeveloper/system11.1.1.2.36.55.36/o.j2ee/drs/TestFileUpload/ModelEJB.jar/-Model] is [TestFileUpload-ViewController-context-root]
    [EL Finest]: 2010-09-22 15:01:13.591--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--End deploying Persistence Unit Model; state Deployed; factoryCount 1
    [EL Finer]: 2010-09-22 15:01:13.623--ServerSession(32436700)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--client acquired
    [EL Finer]: 2010-09-22 15:01:13.623--UnitOfWork(9288343)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--TX binding to tx mgr, status=STATUS_ACTIVE
    [EL Finest]: 2010-09-22 15:01:13.623--UnitOfWork(9288343)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--PERSIST operation called on: fu.model.entity.Document@d52347.
    [EL Finer]: 2010-09-22 15:01:13.638--UnitOfWork(9288343)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--TX beforeCompletion callback, status=STATUS_ACTIVE
    [EL Finer]: 2010-09-22 15:01:13.638--UnitOfWork(9288343)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--begin unit of work commit
    [EL Finer]: 2010-09-22 15:01:13.654--ClientSession(22623994)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--TX beginTransaction, status=STATUS_ACTIVE
    [EL Finest]: 2010-09-22 15:01:13.669--UnitOfWork(9288343)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Execute query InsertObjectQuery(fu.model.entity.Document@d52347)
    [EL Finest]: 2010-09-22 15:01:13.685--ClientSession(22623994)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--reconnecting to external connection pool
    [EL Fine]: 2010-09-22 15:01:13.685--ClientSession(22623994)--Connection(6662457)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--INSERT INTO DOCUMENT (ID, TITLE, DOC, TYPE) VALUES (?, ?, ?, ?)
         bind => [106, Oracle Text 106, [B@b48094, DOC]
    [EL Fine]: 2010-09-22 15:01:13.732--ClientSession(22623994)--Connection(6662457)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--SELECT DOC FROM DOCUMENT WHERE (ID = ?) FOR UPDATE
         bind => [106]
    [EL Finest]: 2010-09-22 15:01:13.873--ClientSession(22623994)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Writing BLOB value(size = 152,064 bytes) through the locator to the table field: DOC
    [EL Finer]: 2010-09-22 15:01:13.888--UnitOfWork(9288343)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--TX afterCompletion callback, status=COMMITTED
    [EL Finer]: 2010-09-22 15:01:13.888--UnitOfWork(9288343)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--end unit of work commit
    [EL Finer]: 2010-09-22 15:01:13.888--UnitOfWork(9288343)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--release unit of work
    [EL Finer]: 2010-09-22 15:01:13.888--ClientSession(22623994)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--client releasedFinest log when it works:
    [EL Finest]: 2010-09-22 15:09:29.741--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Begin deploying Persistence Unit Model; state Predeployed; factoryCount 1
    [EL Finer]: 2010-09-22 15:09:29.787--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Could not initialize Validation Factory. Encountered following exception: java.lang.NoClassDefFoundError: javax/validation/Validation
    [EL Finest]: 2010-09-22 15:09:29.803--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.target-server; value=WebLogic_10; translated value=org.eclipse.persistence.platform.server.wls.WebLogic_10_Platform
    [EL Finest]: 2010-09-22 15:09:29.803--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
    [EL Finest]: 2010-09-22 15:09:29.803--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
    [EL Finest]: 2010-09-22 15:09:29.803--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.target-database; value=Oracle10g; translated value=org.eclipse.persistence.platform.database.oracle.Oracle10Platform
    [EL Finest]: 2010-09-22 15:09:29.834--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=javax.persistence.jtaDataSource; value=jdbc/OracleTextDS
    [EL Finest]: 2010-09-22 15:09:29.834--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.cache.shared.default; value=false; translated value=false
    [EL Finest]: 2010-09-22 15:09:29.834--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--property=eclipselink.jdbc.native-sql; value=true
    [EL Info]: 2010-09-22 15:09:29.866--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--EclipseLink, version: Eclipse Persistence Services - 1.2.0.v20091016-r5565
    [EL Info]: 2010-09-22 15:09:29.866--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Server: WebLogic Server 10.3.2.0  Tue Oct 20 12:16:15 PDT 2009 1267925
    [EL Config]: 2010-09-22 15:09:29.881--ServerSession(29669964)--Connection(16935504)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--connecting(DatabaseLogin(
         platform=>Oracle10Platform
         user name=> ""
         connector=>JNDIConnector datasource name=>jdbc/OracleTextDS
    [EL Config]: 2010-09-22 15:09:29.944--ServerSession(29669964)--Connection(32957960)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Connected: jdbc:oracle:thin:@itimserver:1521:omnidb
         User: OTEXT
         Database: Oracle  Version: Oracle Database 10g Release 10.2.0.1.0 - Production
         Driver: Oracle JDBC driver  Version: 11.1.0.7.0-Production
    [EL Config]: 2010-09-22 15:09:29.944--ServerSession(29669964)--Connection(7874461)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--connecting(DatabaseLogin(
         platform=>Oracle10Platform
         user name=> ""
         connector=>JNDIConnector datasource name=>jdbc/OracleTextDS
    [EL Config]: 2010-09-22 15:09:29.944--ServerSession(29669964)--Connection(7387593)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Connected: jdbc:oracle:thin:@itimserver:1521:omnidb
         User: OTEXT
         Database: Oracle  Version: Oracle Database 10g Release 10.2.0.1.0 - Production
         Driver: Oracle JDBC driver  Version: 11.1.0.7.0-Production
    [EL Info]: 2010-09-22 15:09:30.428--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--file:/C:/oracle/Middleware/jdeveloper/system11.1.1.2.36.55.36/o.j2ee/drs/TestFileUpload/ModelEJB.jar/-Model login successful
    [EL Finest]: 2010-09-22 15:09:30.444--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--The applicationName for the MBean attached to session [file:/C:/oracle/Middleware/jdeveloper/system11.1.1.2.36.55.36/o.j2ee/drs/TestFileUpload/ModelEJB.jar/-Model] is [TestFileUpload]
    [EL Finest]: 2010-09-22 15:09:30.444--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--The moduleName for the MBean attached to session [file:/C:/oracle/Middleware/jdeveloper/system11.1.1.2.36.55.36/o.j2ee/drs/TestFileUpload/ModelEJB.jar/-Model] is [TestFileUpload-ViewController-context-root]
    [EL Finest]: 2010-09-22 15:09:30.444--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--End deploying Persistence Unit Model; state Deployed; factoryCount 1
    [EL Finer]: 2010-09-22 15:09:30.475--ServerSession(29669964)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--client acquired
    [EL Finer]: 2010-09-22 15:09:30.491--UnitOfWork(5094647)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--TX binding to tx mgr, status=STATUS_ACTIVE
    [EL Finest]: 2010-09-22 15:09:30.491--UnitOfWork(5094647)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--PERSIST operation called on: fu.model.entity.Document@1b12136.
    [EL Finest]: 2010-09-22 15:09:30.491--UnitOfWork(5094647)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--PERSIST operation called on: fu.model.entity.Dummy@1fc0ac1.
    [EL Finer]: 2010-09-22 15:09:30.491--UnitOfWork(5094647)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--TX beforeCompletion callback, status=STATUS_ACTIVE
    [EL Finer]: 2010-09-22 15:09:30.491--UnitOfWork(5094647)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--begin unit of work commit
    [EL Finer]: 2010-09-22 15:09:30.506--ClientSession(3813659)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--TX beginTransaction, status=STATUS_ACTIVE
    [EL Finest]: 2010-09-22 15:09:30.537--UnitOfWork(5094647)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Execute query InsertObjectQuery(fu.model.entity.Document@1b12136)
    [EL Finest]: 2010-09-22 15:09:30.553--ClientSession(3813659)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--reconnecting to external connection pool
    [EL Fine]: 2010-09-22 15:09:30.553--ClientSession(3813659)--Connection(31488401)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--INSERT INTO DOCUMENT (ID, TITLE, DOC, TYPE) VALUES (?, ?, ?, ?)
         bind => [107, Oracle Text 107, [B@88e6ad, DOC]
    [EL Fine]: 2010-09-22 15:09:30.584--ClientSession(3813659)--Connection(31488401)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--SELECT DOC FROM DOCUMENT WHERE (ID = ?) FOR UPDATE
         bind => [107]
    [EL Finest]: 2010-09-22 15:09:30.725--ClientSession(3813659)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Writing BLOB value(size = 152,064 bytes) through the locator to the table field: DOC
    [EL Finest]: 2010-09-22 15:09:30.725--UnitOfWork(5094647)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Execute query InsertObjectQuery(fu.model.entity.Dummy@1fc0ac1)
    [EL Fine]: 2010-09-22 15:09:30.725--ClientSession(3813659)--Connection(31488401)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--INSERT INTO DUMMY (ID, DUMMYCOLUMN, DOCUMENT_ID) VALUES (?, ?, ?)
         bind => [107, null, null]
    [EL Finer]: 2010-09-22 15:09:30.772--UnitOfWork(5094647)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--TX afterCompletion callback, status=COMMITTED
    [EL Finer]: 2010-09-22 15:09:30.772--UnitOfWork(5094647)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--end unit of work commit
    [EL Finer]: 2010-09-22 15:09:30.772--UnitOfWork(5094647)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--release unit of work
    [EL Finer]: 2010-09-22 15:09:30.772--ClientSession(3813659)--Thread(Thread[[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--client releasedRegards,
    Alexandar

  • Oracle blob class problem

    Hello again.
    I have the following code:
    java.sql.ResultSet resultSetForUpdate = stat.executeQuery("select picture from some_table where some_id=" + someId + " for update");
    java.sql.Blob blob = resultSetForUpdate.getBlob(1);
    // here is some code that types the class of the blob
    logger.info("blob class is: "+blob.getClass());
    now the problem is that the class returned with blob.getClass is different on 2 portals... on 1 portal I get oracle.sql.BLOB (this is the expected result) but on the other I get com.inqmy.services.dbpool.remote.RemoteBlobImpl
    does anyone have any idea why this is happening and how can I do so that I always get the oracle.sql.BLOB class?
    more information: both portal installations are ep6 sp2 with (I think) identical patch levels (35 if I remember correctly). the database they access is the same one. the dbpool definitions (in visual administrator) look similar.
    thanks in advance.
    silviu.

    Thanks for taking the time to look at this.
    No, it is the same driver on both servers. The driver is the oracle driver oracle.jdbc.OracleDriver provided by Oracle themselves.
    This is not it...
    Could there be some path problem? The server on which it works fine is a windows machine, whereas the server where it doesnt work is a solaris machine, I think (not windows for sure).
    Message was edited by: Silviu Lipovan Oanca

  • BLOB retrieval problem

    I create one function to retrieve PDF file in BLOC column and store the result
    in UNIX file to be able to see it with ACROBAT.
    see my function
    CREATE OR REPLACE FUNCTION GET_PDF_STATEMENT ( p_filename IN VARCHAR2,
         p_request_id IN NUMBER )
         RETURN NUMBER
              IS return_code NUMBER;
    temp_blob BLOB;
    data_buffer RAW (1);
    temp_buffer VARCHAR2(1);
    amount BINARY_INTEGER := 1;
    position INTEGER := 1;
    filehandle utl_file.file_type;
    error_number NUMBER;
    error_message VARCHAR2(100);
    v_error VARCHAR2(100);
    directory_statement VARCHAR2(100);
    length_count INTEGER;
    BEGIN
    SELECT statement_pdf_file
    INTO temp_blob
    FROM nat_statement_pdf
    WHERE filename = p_filename
    and request_id = p_request_id;
    length_count := dbms_lob.getlength(temp_blob);
    dbms_output.put_line('Internal LOB size is: ' || length_count);
    SELECT directory_path
    into directory_statement
    from dba_directories
    where directory_name = 'STATEMENT_PDF_REPORT_DIR';
    filehandle := utl_file.fopen(directory_statement,
              p_filename,'W');
    WHILE length_count <> 0 LOOP
    dbms_lob.read (temp_blob, amount, position, data_buffer);
    temp_buffer := utl_raw.cast_to_varchar2(data_buffer);
    utl_file.put (filehandle, temp_buffer);
    position := position + 1;
    length_count := length_count - 1;
    data_buffer := null;
    END LOOP;
    return_code := 0;
    dbms_output.put_line('Exit the loop');
    utl_file.fclose(filehandle);
         dbms_output.put_line('Close the file');
    return(return_code);
    EXCEPTION
    WHEN OTHERS THEN
    BEGIN
    v_error := sqlerrm;
         insert into message_marc ( message) values ( v_error );
         error_number := sqlcode;
    insert into message_marc ( message) values ( to_char(error_number) );
    return_code := error_number;
         error_message := substr(sqlerrm ,1 ,100);
         dbms_output.put_line('Error #: ' || error_number);
         dbms_output.put_line('Error Message: ' || error_message);
         utl_file.fclose_all;
         commit;
         return(return_code);
    END;
    END;
    I have the problem with file bigger than 32 ; i printed the value of sqlerrm and sqlcode
    the results ar sqlerrm = User-defined exception
    sqlcode = 1
    Ony body can help me
    Thanks
    Marc

    Hi
    Call the function without exepction handling and post the error message and the number of the line where the error occures.
    Ott Karesz
    http://www.trendo-kft.hu

  • Blob interface problem

    hi all,
    im facing an stylist problem when inserting blob into oracle dbms. im trying in a very simple way like this :
    stmt.executeUpdate("insert into picture values('sample1.gif',empty_blob())");
    ResultSet rs= stmt.executeQuery("select * from picture where name='sample1.gif' for update");
              rs.next();
              oracle.sql.BLOB blob=(oracle.sql.BLOB)rs.getBlob(2);
              FileInputStream in= new FileInputStream(filename);
              OutputStream os=blob.getBinaryOutputStream();
              int data;
              while((data=in.read())!=-1){
                             os.write(data);
         in.close();
         os.close();
    this code is ok but i have an allergy about standerizing my coding so im trying to use the following code :
    stmt.executeUpdate("insert into picture values('sample1.gif',empty_blob())");
    ResultSet rs= stmt.executeQuery("select * from picture where name='sample1.gif' for update");
              rs.next();
              java.sql.Blob blob=rs.getBlob(2);
              FileInputStream in= new FileInputStream(filename);
              OutputStream os=blob.setBinaryStream(1);
              int data;
              while((data=in.read())!=-1){
                             os.write(data);
         in.close();
         os.close();
    but the problem is setBinaryStream(int pos) is not implemented by oracle.sql.BLOB class. my oracle version is 9.0.1.0.1. when i run it,it shows an exception like abtract method error. is there any way not to use the oracle.sql.BLOB for inserting blob into oracle database ?

    I can't give a definitive answer but I've observed the same problem.
    The ability to get an outputstream to a Clob was only introduced in JDBC 3.0.
    Chapter 5 of Oracle's JDBC Developer's Guide and Reference http://download-west.oracle.com/docs/cd/B10501_01/java.920/a96654/jdbc30ov.htm#1004903 mentions that only some JDBC 3.0 features are implemented; none of the mentioned features include the API calls for streaming to a Clob.
    T

  • Help abt store and delete images as blob & bfile using Visual C++

    Hi
    Does anyone knows if there is code for visual c++
    to store and delete images as blob or bfile?
    thanx

    The documentation states there are examples in the oracle database distribution: <ORACLE_HOME>/rdbms/demo/cdemolb.c <ORACLE_HOME>/rdbms/demo/cdemolb2.c <ORACLE_HOME>/rdbms/demo/cdemolbs.c
    These examples are in c, but can be used in c++
    http://otn.oracle.com/doc/server.815/a67846/app_exam.htm#430289

  • Using BLOB,BFILE

    hello Gurus,
    I want to know these two things
    ٭ How to use BLOB data type?
    ٭ How to use BFILE data type?
    Regards
    Santosh Kumar

    Apart from what Raford mentioned, you should also keep in mind about the security aspect of it.
    Documents stored in db are more secured or can be made more secured.
    When you use bfiles, they are stored in OS and thus can be deleted intentionally or by mistake.
    Performance wise, they donot make much difference even though bfile have an overhead of going to file system to fetch the fiiles/information.

  • BLOB Insertion Problem

    We are inserting a BLOB in our table. If the size of BLOB is greater than 5KB, it's not being inserted. Smaller BLOBs are being entered successfully. Is ther some default parameter which need to be set.

    AFAIK there is no such initialization parameter.
    How do you insert BLOB ? Which is the host language ?
    Which use case described in http://download-uk.oracle.com/docs/cd/B10501_01/appdev.920/a96591/adl10pst.htm#125074 is the closest to the one you are using ?

  • In a region iframe src a blob file problem?

    hi ,
    I try to make an example like this:I have a table which store blob files.And I try to see the file content in html region
    htp.p('<iframe src="ptest?n='||:P1_FILE_ID||'" width="650" height="450" />
    </iframe>
    <item name="deneme" type="button" onclick="doSubmit(NEXT)"></item>');
    to display the file in a frame but ı cant see in the frame.when button next submit the other file must be seen but always alert open file or save message but ı dont want this ı want to see the file content in iframe region.Can you help.
    thanks.

    This is how i am setting the property.
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModuleImpl am =(OAApplicationModuleImpl)pageContext.getRootApplicationModule();
    OAPageLayoutBean pagelayoutbean = pageContext.getPageLayoutBean();
    OAStackLayoutBean stacklayoutbean = (OAStackLayoutBean)pagelayoutbean.findIndexedChildRecursive("xxdbdIROneTimeAddressRN");
    if("enableaddress".equals(pageContext.getParameter(EVENT_PARAM))) {
    stacklayoutbean.setRendered(true);
    The region 'xxdbdIROneTimeAddressRN' is having messagelovinput bean.

  • BLOB/filter problem

    Hello,
    I am using 8.1.7 on Solaris. I store a Word document in a blob column and index it without errors. However when I try to select from this column using "select...contains" it always results in zero rows being returned. Changing the filter to NULL_filter using the 'parameters' clause in the create index statement works, but the DR$ table contains a lot of binary chars as well as text as a result.
    If anyone could help I'd be most grateful.
    Thanks,
    HN

    Thank you for your reply. Here is the script.
    drop table ImageTable;
    create table ImageTable
    (myCount number, myImage blob);
    alter table ImageTable add constraint pk_imageTable primary key (myCount);
    insert into ImageTable values(1, empty_blob());
    commit;
    create index idx_imageTable on imageTable(myImage) indextype is ctxsys.context;
    -- create index idx_imageTable on imageTable(myImage) indextype is ctxsys.contex
    t parameters('filter ctxsys.null_filter');
    The following lines insert a Word95 doc which contains only one line:
    "This is a test document."
    host javac SearchW2K.java
    host java SearchW2K
    alter index idx_imageTable rebuild online parameters('sync');
    select myCount from imageTable where contains(myImage,'test') > 0;
    null

  • Blob(jpg) problem in Forms6!!

    I am working with forms6 and oracle8 and I have intend to view some jpg files that they are store in my Database, in mode enter_query I press execute query and:
    I don’t know why some of them, I can view them but and I cant’n view some ones, can anyone help me or answer me why happened that,
    Thank you and Any help would be greatly appreciated!
    Jugasaro

    the blob brush keeps the settings
    of the brush tool (unless you selected other than a calligraphy brush)
    to keep the blob brush from loosing its settings, click into the empty space of the brushes-palette to deselect the brush you used with the brush tool

Maybe you are looking for

  • OAM Authorization POST parameters

    Dear all, I have a question about the authorization rules in OAM, my requirement is that I want on successful authorization to send a POST parameter to a protected application this parameter will include some piece of data of the logged in user (for

  • Syncing ipad to iTunes error message

    I have a new MAC and an older iPad.  I initially synced it, but, now it will no longer let me do that.  I open the iTunes, can see that the iPad is connected, hit the sync button and then wait.  It goes through steps 1 and 2 and then flashes to the s

  • How to find the client number of xMII server i m running

    Hi experts, Here i am simply providing the URL in my browser and it shows the login page of xMII server.But i want to find under which client i am currently running this xMII ,how can i find that client number? Thanks , S.Ramesh Kumar.

  • Forms9i with 10gAS

    HI Gentlemen, I have a 9i DB, 9iDS and 10gASFrs installed on an XP machine. As stated in the 10gAS doc, I created a simple config section [myconfig] with only form=myform and userid=usr/pwd@dblink in FORMSWEB.CFG, added my path to FORMS90_PATH in DEF

  • Can't select the element I want

    Hi Experts, I am trying to customize the Two-column Left Nav Layout that is provided by DW. My first modification is to place everything within the body tag inside a new div called divWrapper, in order to establish a width of 800px and to center the