Concurrency and Oracle Object Types

Hi All,
I have a question regarding Concurrent usage of an Object type in Oracle.
I have a java program which calls an Oracle stored proc with the object's table type as IN parameter. In my stored proc, I am populating an Oracle Object with data received from java and retrieving some data based on that.
My java program can be invoked concurrently by 500 users at the same time - the application is built to handle that request load.
Now in Oracle, if a bunch of requests are received at the same, would Oracle create multiple instances of this object type that would be usage to the multiple stored proc invocations? Or would there be a prob of concurrency?
If multiple instance creation is not supported, is there some alternative I can use?
My code roughly resembles:
Object:
contains two columns - name, age
Stored proc - logic to retrieve and return data from a table based on the name, age received.
When a bunch of requests access the stored proc simultaneously, will a bunch of instnaces of the object type get created? Or would there be a scenario where the object is common to all requests and hence data from one request would be conflicted due to data from another request?

Hi Wiiliam
Sorry for the late acknowledgement (i dozed off!).. Thanks for the response. So the private instance specific to a session ensure that theres no conflict between multiple requests to the same stored proc and hence no conflict of data... Great
Chaitanya

Similar Messages

  • ERD and oracle object types

    Is there a good way to model oracle object types using ERD's in designer 6i. I can only figure out how to map to tables with columns of predefined datatypes (varchar2, number, date, long). I'd like to use designer to create new datatypes. Is this possible? Thanks.

    Hi Wiiliam
    Sorry for the late acknowledgement (i dozed off!).. Thanks for the response. So the private instance specific to a session ensure that theres no conflict between multiple requests to the same stored proc and hence no conflict of data... Great
    Chaitanya

  • Require help on Array of Nested tables and Oracle Object type

    Hi All,
    I have a scenario where I have some millions of records received from a flat file and the record is stored in Table as below:
    Tablename: FILE_RECORD
    Rows:
    FILE_REG_ID = 1
    RECORD_NBR = 1     
    PROCESSED_IND = U
    RECORD= 00120130326006A
    FILE_REG_ID = 1
    RECORD_NBR = 2     
    PROCESSED_IND = U
    RECORD= 00120130326003
    1) I have to read these records at once and
    a) Split the RECORD column to get various other data Eg: Fld1=001, Fld2=20130326, Fld3 = 003
    b) send as an Array to Java.
    2) Java will format this into XML and sent to other application.
    3) The other application returns a response as Successful or Failure to Java in XML
    4) Java will send RECORD_NBR and the corresponding response as Success or Failure back to PLSQL
    5) PLSQL should match the RECORD_NBR and update the PROCESSED_IND = P.
    I 'm able to achieve this using SQL Table type by creating a TYPE for Each of the fields (Flds) however the problem is Java cannot Access the parameters as the TYPE are of COLUMN Types
    Eg: For RECORD_NBR
    SUBTYPE t_record_nbr IS FILE_RECORD.T010_RECORD_NBR%TYPE;
    Can you please let me know how I can achieve this to support Java, I know one way that is by creating an OBJECT TYPE and a TABLE of the OBJECT TYPE.
    Eg: T_FILE_RECORD_REC IS OBJECT
    FILE_REG_ID number(8), RECORD_NBR number (10), PROCESSED_IND varchar2(1), RECORD varchar(20)
    Create type T_FILE_RECORD_TAB IS TABLE OF T_FILE_RECORD_REC
    However I'm facing a problem to populate an Array of records, I know I'm missing something important. Hence please help.
    It would be helpful to provide some guidelines and suggestions or Pseudo or a Code to achieve this. Rest all I can take up further.
    Thanks in advance,

    I know once way that is creating a OBJECT TYPE and a TABLE of OBJECT TYPE, howeve I feel I'm missing something to achieve this.You're right, you need SQL object types created at the database level. Java doesn't know about locally defined PL/SQL types
    However you can do without all this by creating the XML directly in PL/SQL (steps 1+2) and passing the document to Java as XMLType or CLOB.
    Are you processing the records one at a time?

  • Oracle Object Types and XML

    Hi All
    I have oracle object types created.
    <code>
    CREATE OR REPLACE
    TYPE CONFIRM_APP_CONFIRM_ENQUIRY_AT AS OBJECT
    ENQATTRIBTYPECODE VARCHAR2(1000),
    ENQATTRIBVALUECODE VARCHAR2(1000),
    ENQATTRIBSTRINGVALUE VARCHAR2(1000),
    ENQATTRIBNUMVALUE NUMBER,
    ENQATTRIBDATEVALUE DATE
    </code>
    I m using this type for couple of columns in a table
    and then i try to use this procedure which generates XML
    <code>
    BEGIN
    MY_SQL :=
    DBMS_XMLQUERY.NEWCONTEXT
    ( 'Select Nvl(Enquiry_Number,9999) "EnquiryNumber",
    External_System_Reference "ExternalSystemReference",
    External_System_Number "ExternalSystemNumber",
    Service_Code "ServiceCode",
    Subject_Code "SubjectCode",
    Enquiry_Description "EnquiryDescription",
    Enquiry_Location "EnquiryLocation",
    Enquiry_Status_Code "EnquiryStatusCode",
    Assigned_Office_Code "AssignedOfficerCode",
    Logged_Time "LoggedTime",
    EnquiryX "EnquiryX",
    EnquiryY "EnquiryY",
    Site_Code "SiteCode",
    Central_Asset_Id "CentralAssetId",
    Contact_Name "ContactName",
    Contact_Phone "ContactPhone",
    Contact_Fax "ContactFax",
    Contact_Email "ContactEmail",
    Enquiry_Reference "EnquiryReference",
    Enquiry_Class_Code "EnquiryClassCode",
    Notice_From_Org_Code "NoticeFromOrgCode",
    Works_Reference "WorksReference",
    Job_Number "JobNumber",
    Address_Reference "AddressReference",
    enquiry_attribute1 "EnquiryAttribute",
    enquiry_attribute2 "EnquiryAttribute",
    enquiry_attribute3 "EnquiryAttribute",
    enquiry_attribute4 "EnquiryAttribute",
    enquiry_attribute5 "EnquiryAttribute",
    enquiry_attribute6 "EnquiryAttribute",
    enquiry_attribute7 "EnquiryAttribute",
    enquiry_attribute8 "EnquiryAttribute",
    enquiry_attribute9 "EnquiryAttribute",
    enquiry_attribute10 "EnquiryAttribute",
    enquiry_attribute11 "EnquiryAttribute",
    enquiry_attribute12 "EnquiryAttribute",
    enquiry_attribute13 "EnquiryAttribute",
    enquiry_attribute14 "EnquiryAttribute",
    enquiry_attribute15 "EnquiryAttribute",
    enquiry_attribute16 "EnquiryAttribute",
    enquiry_attribute17 "EnquiryAttribute",
    enquiry_attribute18 "EnquiryAttribute",
    enquiry_attribute19 "EnquiryAttribute",
    enquiry_attribute20 "EnquiryAttribute",
    enquiry_customer "EnquiryCustomer",
    enquiry_document "DocumentLink"
    FROM XXHCC_HOLDING_CONFIRM WHERE
    EXTERNAL_SYSTEM_REFERENCE ='
    || EXTERNAL_SYSTEM_REFERENCE
    || '
    AND message_status = ''FAIL'''
    DBMS_XMLQUERY.SETROWSETTAG (MY_SQL, 'Operation');
    DBMS_XMLQUERY.SETROWTAG (MY_SQL, 'NewEnquiry');
    L_XML := DBMS_XMLQUERY.GETXML (MY_SQL);
    DBMS_XMLQUERY.CLOSECONTEXT (MY_SQL);
    </code>
    when i get the xml as output, i get this..
    <code>
    <Operation>
    <NewEnquiry num="1">
    <EnquiryNumber>9999</EnquiryNumber>
    <ExternalSystemReference>4343017</ExternalSystemReference>
    <ExternalSystemNumber>1</ExternalSystemNumber>
    <ServiceCode>HWAY</ServiceCode>
    <SubjectCode>MAIN</SubjectCode>
    <EnquiryDescription>TAI-Highway Maintenance</EnquiryDescription>
    <EnquiryLocation>O/S Cheese Pub</EnquiryLocation>
    <LoggedTime>2008-04-09T08:33:36</LoggedTime>
    <SiteCode>19101890</SiteCode>
    <ContactName>MRS xyz</ContactName>
    <ContactPhone>3434343</ContactPhone>
    <EnquiryReference>CRMHUB</EnquiryReference>
    <NoticeFromOrgCode>ABC</NoticeFromOrgCode>
    <WorksReference>4343017</WorksReference>
    <EnquiryAttribute>
    <ENQATTRIBTYPECODE>CSPL</ENQATTRIBTYPECODE> <ENQATTRIBSTRINGVALUE>n.a</ENQATTRIBSTRINGVALUE>
    </EnquiryAttribute>
    <EnquiryAttribute>
    <ENQATTRIBTYPECODE>CSAI</ENQATTRIBTYPECODE>
    <ENQATTRIBSTRINGVALUE>Cracked Path-Loose Flagstone</ENQATTRIBSTRINGVALUE>
    </EnquiryAttribute>
    <EnquiryAttribute> <ENQATTRIBTYPECODE>CSDL</ENQATTRIBTYPECODE> <ENQATTRIBSTRINGVALUE>No</ENQATTRIBSTRINGVALUE>
    </EnquiryAttribute>
    <EnquiryAttribute>
    <ENQATTRIBTYPECODE>CSIM</ENQATTRIBTYPECODE>
    </EnquiryAttribute>
    <EnquiryAttribute/>
    <EnquiryAttribute/>
    <EnquiryAttribute/>
    <EnquiryAttribute/>
    <EnquiryAttribute/>
    <EnquiryAttribute/>
    <EnquiryAttribute/>
    <EnquiryAttribute/>
    <EnquiryAttribute/>
    <EnquiryAttribute/>
    <EnquiryAttribute/>
    <EnquiryAttribute/>
    <EnquiryAttribute/>
    <EnquiryAttribute/>
    <EnquiryAttribute/>
    <EnquiryAttribute/>
    <ENQUIRY_CUSTOMER>
    <CUSTOMER_ALT_PHONE>00</CUSTOMER_ALT_PHONE>
    <CUSTOMER_PRIMARY_ADDRESS>,,0, ABC Street</CUSTOMER_PRIMARY_ADDRESS>
    <CUSTOMER_TOWN_NAME>UK</CUSTOMER_TOWN_NAME>
    <CUSTOMER_COUNTY_NAME>UK</CUSTOMER_COUNTY_NAME>
    <CUSTOMER_POST_CODE>AB1 3QT</CUSTOMER_POST_CODE>
    </ENQUIRY_CUSTOMER>
    </NewEnquiry>
    </Operation>
    </code>
    My question is i m transferring this XML to a third party webservice and it does inserting into a third party application.
    The problem is if you look under EnquiryAttribute tag ENQATTRIBSTRINGVALUE and ENQATTRIBTYPECODE i need this to be in lowercase.
    As the xml is getting automatically generated how do i achieve this. I feel them in the uppercase is causing problems at the other end.
    Any help appreciated
    Srini
    Message was edited by:
    sikhasrinivas

    Use "..." delimiters in the CREATE TYPE (and in all your code that references the type).

  • Problem using Oracle Object Types and Arrays.

    I'm currently trying to work with oracle object types in java and I'm running into some issues when trying to add an item to an array.
    The basic idea is that I have a header object and a detail object (both only containing an ID and a description). Inside of my java code I'm trying to add a new detail line to the header that has been retrieved from the database.
    Here's what I'm working with.
    --Oracle Objects:
    CREATE OR REPLACE TYPE dtl_obj AS OBJECT
        detail_id INTEGER,
        header_id INTEGER,
        detail_desc VARCHAR2(300)
    CREATE TYPE dtl_tab AS TABLE OF dtl_obj;
    CREATE OR REPLACE TYPE hdr_obj AS OBJECT
        header_id INTEGER,
        src VARCHAR(30),
        details dtl_tab
    CREATE TYPE hdr_tab AS TABLE OF hdr_obj;
    /--Java test methods
         public static void main(String[] args) throws SQLException,
                   ClassNotFoundException
              // Initialize the objects
              Test t = new Test();
              t.connect(); //Connects to the database
              //The oracle connection will be accessible through t.conn
              // Create the oracle call
              String query = "{? = call get_header(?)}";
              OracleCallableStatement cs = (OracleCallableStatement) t.conn.prepareCall(query);
              cs.registerOutParameter(1, OracleTypes.ARRAY, "HDR_TAB"); //Register the out parameter and associate it with our oracle type
              int[] hdrs = { 240 }; //we just want one for testing.
              ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor(
                        "ARRAY_T", t.conn);
              oracle.sql.ARRAY oHdrs = new ARRAY(descriptor, t.conn, hdrs);
              cs.setARRAY(2, oHdrs); //Set the headers to retrieve
              // Execute the query
              cs.executeQuery();
              try
                   ARRAY invArray = cs.getARRAY(1);
                   // Start the retrieval process
                   Class cls = Class.forName(Header.class.getName());
                   Map<String, Class<?>> map = t.conn.getTypeMap();
                   map.put(Header._SQL_NAME, cls);
                   Object[] invoices = (Object[]) invArray.getArray();
                   ArrayList<Header> invs = new ArrayList(
                             java.util.Arrays.asList(invoices));
                   if (invs != null)
                        for (Header inv : invs)
                             System.out.println(inv.getHeaderId() + " " + inv.getSrc());
                             t.addDetail(inv, "new line");
                             for (Detail dtl : inv.getDetails().getArray()) // Exception thrown here
    //                              java.sql.SQLException: Fail to construct descriptor: Invalid arguments
    //                              at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
    //                              at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
    //                              at oracle.jdbc.driver.DatabaseError.check_error(DatabaseError.java:861)
    //                              at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:128)
    //                              at oracle.jpub.runtime.MutableStruct.toDatum(MutableStruct.java:109)
    //                              at com.pcr.tst.Detail.toDatum(Detail.java:40)
    //                              at oracle.jpub.runtime.Util._convertToOracle(Util.java:151)
    //                              at oracle.jpub.runtime.Util.convertToOracle(Util.java:138)
    //                              at oracle.jpub.runtime.MutableArray.getDatumElement(MutableArray.java:1102)
    //                              at oracle.jpub.runtime.MutableArray.getOracleArray(MutableArray.java:550)
    //                              at oracle.jpub.runtime.MutableArray.getObjectArray(MutableArray.java:689)
    //                              at oracle.jpub.runtime.MutableArray.getObjectArray(MutableArray.java:695)
    //                              at com.pcr.tst.DetailTable.getArray(DetailTable.java:76)
    //                              at com.pcr.tst.Test.main(Test.java:91)
                                  System.out.println(dtl.getDetailDesc());
              catch (Exception ex)
                   System.out.println("Error while retreiving header");
                   ex.printStackTrace();
              public void addDetail(Header hdr, String desc) throws Exception
              if (hdr == null)
                   throw new Exception("header not initialized");
              // Convert the current list to an ArrayList so we can easily add to it.
              ArrayList<Detail> dtlLst = new ArrayList<Detail>();
              dtlLst.addAll(java.util.Arrays.asList(hdr.getDetails().getArray()));
              // Create the new detail
              Detail dtl = new Detail();
              dtl.setDetailDesc(desc);
              // add the new detail
              dtlLst.add(dtl);
              Detail[] ies = new Detail[dtlLst.size()];
              ies = dtlLst.toArray(new Detail[0]);
              DetailTable iet = new DetailTable(ies);
              hdr.setDetails(iet);
         }I know its the addDetail method causing the issue because if I comment out the t.addDetail(inv, "new line"); call it works fine.
    Message was edited by:
    pcristini

    Oracle® Database Object-Relational Developer's Guide
    Also note that object relational database design is often less performant and scalable than relational. It is not very often used in production environments.
    However, the object orientated programming feature that is provided with Oracle object feature set are used and can make development and interfaces a lot easier.
    So in a nutshell. Say no to ref and nested table columns. Say yes to most of the other object features. IMO of course...

  • How to return Values from Oracle Object Type to Java Class Object

    Hello,
    i have created an Oracle Object Types in the Database. Then i created Java classes with "jpub" of these types. Here is an example of the type.
    CREATE OR REPLACE TYPE person_type AS OBJECT
    ID NUMBER,
    vorname VARCHAR2(30),
    nachname VARCHAR2(30),
    geburtstag DATE,
    CONSTRUCTOR FUNCTION person_type RETURN SELF AS RESULT,
    CONSTRUCTOR FUNCTION person_type(p_id NUMBER) RETURN SELF AS RESULT,
    CONSTRUCTOR FUNCTION person_type(p_vorname VARCHAR2,
    p_nachname VARCHAR2,
    p_geburtstag DATE) RETURN SELF AS RESULT,
    MEMBER FUNCTION object_exists(p_id NUMBER) RETURN BOOLEAN,
    MEMBER PROCEDURE load_object(p_id NUMBER),
    MEMBER PROCEDURE save_object,
    MEMBER PROCEDURE insert_object,
    MEMBER PROCEDURE update_object,
    MEMBER PROCEDURE delete_object
    MEMBER PROCEDURE load_object(p_id NUMBER) IS
    BEGIN
    SELECT p.id, p.vorname, p.nachname, p.geburtstag
    INTO SELF.ID, SELF.vorname, self.nachname, SELF.geburtstag
    FROM person p
    WHERE p.id = p_id;
    END;
    My problem is, that if i use the member function "load_object" from my java app it doesnt return the selected values to the java class and i dont know why. I use the java class like this:
    PersonObjectType p = new PersonObjectType();
    p.load_object(4);
    There is a reocrd in the database with id = 4 and the function will execute successful. But if i try to use "p.getVorname()" i always get "NULL". Can someone tell me how to do that?
    Thanks a lot.
    Edited by: NTbc on 13.07.2010 15:36
    Edited by: NTbc on 13.07.2010 15:36

    CallableStatement =
    "DECLARE
    a person_type;
    BEGIN
    a.load_object(4);
    ? := a;
    END;"
    And register as an out parameter.
    Edited by: michael76 on 14.07.2010 05:01

  • Oracle Object Types vs. Table Fields

    Hello, all.
    I`m totally new to Oracle, and I am facing a very hard problem for me, and I would like to ask your help.
    I've been working on a project which uses Oracle Object Types, from a database of a legacy system.
    I did not know Oracle Objects until 5 minutes ago, so sorry If I say something stupid:
    Per my understanding, a Oracle Object Type can be formed by fields like myField varchar(200)... and fields from an existing table or view.
    I have a lot of objects on my system and I need to map each field and its respective table or view that compose each object.
    Does anyone have a query for that? I think it should be common, but I could not find anything at google (maybe I don`t which terms use to find...)
    I would be very thankful if somebody could help (save) me.
    Thanks in advance.
    Paulo

    First, it would help if you post what you object types look like.
    I'm assuming they may look something like this:
    SQL> create TYPE emp_type AS OBJECT
      2    (emp_id   NUMBER,
      3     name VARCHAR2(20));
      4  /
    Type created.
    SQL> create TYPE emp_tab IS TABLE OF emp_type;
      2  /
    Type created.
    SQL> create or replace package emp_test as
      2  procedure get_emps;
      3  end emp_test ;
      4  /
    Package created.
    SQL> create or replace package body emp_test as
      2    employees emp_tab := emp_tab();
      3    procedure get_emps as
      4      g_rc sys_refcursor;
      5  BEGIN
      6    employees.EXTEND(2);
      7    employees(1) := emp_type (1, 'John Smith');
      8    employees(2) := emp_type (2, 'William Jones');
      9    OPEN g_rc FOR
    10    SELECT * FROM TABLE (CAST (employees AS emp_tab));
    11  END get_emps ;
    12  end emp_test ;
    13  /
    Package body created.

  • Working with oracle object type tables

    Hi,
    I've created a table which only contains Oracle object types (e.g. CREATE TABLE x OF <...>). When I create an Entity for this table using the Entity wizard, I end up with an entity with the attributes of the base object type and two special attributes REF$ (reference to the object type instance) and SYS_NC_OID$ (unique object identifier). The REF$ attribute is on the Java side of type oracle.jbo.domain.Ref and the other attribute is on the Java side a simple String.
    It seems this only allows me to save objects of the base type in this table. First of all in my situation this is also impossible because the base type is not instantiable. What I do want is to save several different subtypes into this table using the BC4J custom domain mechanism. Is there any way to make this possible? I first thought I could maybe do something with the special REF$ attribute, but this doesn't seem te case. So I might need to override most of the EntityImpl methods, like doUML, remove etc. Am I right? And does anyone have any hints on how to do this?
    Regards,
    Peter

    Peter:
    Hi,
    I've created a table which only contains Oracle
    object types (e.g. CREATE TABLE x OF <...>).
    When I create an Entity for this table using the
    Entity wizard, I end up with an entity with the
    attributes of the base object type and two special
    attributes REF$ (reference to the object type
    instance) and SYS_NC_OID$ (unique object identifier).
    The REF$ attribute is on the Java side of type
    oracle.jbo.domain.Ref and the other attribute is on
    the Java side a simple String.
    It seems this only allows me to save objects of the
    base type in this table. First of all in my situation
    this is also impossible because the base type is not
    instantiable. What I do want is to save several
    different subtypes into this table using the BC4J
    custom domain mechanism. Is there any way to make
    this possible? Sorry, but this is not supported out of the box.
    Since you have an object table, you wouldn't use domains to achieve this. Instead, you would have a superclass and subclass entity objects, e.g., PersonEO subclassed into StudentEO and EmployeeEO.
    I first thought I could maybe do
    something with the special REF$ attribute, but this
    doesn't seem te case. So I might need to override
    most of the EntityImpl methods, like doUML, remove
    etc. Am I right? And does anyone have any hints on
    how to do this?
    If you want, you can try this by overridding EntityImpl's:
       protected StringBuffer buildDMLStatement(int operation,
          AttributeDefImpl[] allAttrs,
          AttributeDefImpl[] retCols,
          AttributeDefImpl[] retKeys,
          boolean batchMode)
    and
       protected int bindDMLStatement(int operation,
          PreparedStatement stmt,
          AttributeDefImpl[] allAttrs,
          AttributeDefImpl[] retCols,
          AttributeDefImpl[] retKeys,
          HashMap retrList,
          boolean batchMode) throws SQLException
    Handle the case when operation == DML_INSERT.
    There, build an insert statement with substitutable row, e.g.:
    INSERT INTO persons VALUES (person_t('Bob', 1234));
    INSERT INTO persons VALUES (employee_t('Joe', 32456, 12, 100000));
    where person_t and employee_t are database types and you are invoking the respective constructor.
    Thanks.
    Sung

  • Inconsistent java and sql object types

    Hi,
    I have run into error "Inconsistent java and sql object types"
    while mapping a java class to a sql object type. The java class
    is just a duplicate of sql data structure and I pretty much
    follow the JDBC Developer's GUide's examples (20-43 to 20-45)
    to create the mapping java class.
    Any one runs into simliar problem or any clues?
    Thanks,
    Ed
    Exception in thread "main" java.sql.SQLException: Inconsistent java and sql object types: InstantiationException:
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.sql.STRUCT.toClass(STRUCT.java:433)
    at oracle.sql.STRUCT.toJdbc(STRUCT.java:366)
    at oracle.jdbc.oracore.OracleTypeUPT.unpickle80rec
    (OracleTypeUPT.java:236)
    at
    oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle80rec_elems
    (OracleTypeCOLLECTION.java:553)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle80rec
    (OracleTypeCOLLECTION.java:383)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle80
    (OracleTypeCOLLECTION.java:329)
    at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize
    (OracleTypeCOLLECTION.java:218)
    at oracle.sql.ArrayDescriptor.toJavaArray
    (ArrayDescriptor.java:501)
    at oracle.sql.ARRAY.getArray(ARRAY.java:197)

    The safest way would be to use JPublisher to generate the type classes. In your application, you can just use the generated code to manipulate the object.

  • Designer and SDO_GEOMETRY object type

    I want to have tables with columns of object type MDSYS.SDO_GEOMETRY (Oracle Spatial's type) in Designer 9i and then generate these tables.
    So I created in Oracle Object Types branch object type called MDSYS.SDO_GEOMETRY without attributes, methods or source table.
    Then I created in Designer table with column named GEOMETRY which has Datatype property empty and Oracle Type property of value MDSYS.SDO_GEOMETRY.
    But when I generate this table I get these two messages:
    CDS-11349 Warning: The Oracle Object Type MDSYS.SDO_GEOMETRY cannot be generated.
    CDS-18025 Error: Table 'PRK_PRIMER_GEO_SDO' will not be created as Oracle Object Type 'MDSYS.SDO_GEOMETRY' is not created
    Object type MDSYS.SDO_GEOMETRY already exists in database for sure.
    What is wrong here?
    Regards
    Saso Celarc

    I think, Designer cannot handle SDO_GEOMETRY type.
    Workaround: use a other datatype/size not used in your schema ( such as varchar2(99) ), generate scripts and do a text substitution on them to SDO_GEOMETRY.

  • Domains for Oracle object types

    When I create a domain for a certain Oracle object type there is no way to create some kind of inheritance tree (and there is no discriminator support it seems). On the database level I have several object types that extend a certain base object type. I want to do the same at the BC4J level. But unfortunately this doesn't seem possible. Is there a work-around for it? I don't mind to write a little extra code, any hints or help are appreciated.
    Regards,
    Peter
    P.S.
    It seems the object type / domain support in JDeveloper 9.0.3(.1) isn't quite up there with entities and view objects. It's not even possible to change an attribute name at the Java side using the domain dialog (it's only possible by manually editing the XML and Java files). Will JDeveloper 9.0.4 have broader support for object types / domains?

    I've found a way to implement the inheritance myself, at least a start. I've noticed all custom domains for oracle object types have the static method "getCustomerDatumFactory". In this method (in the base domain class) normally an instance of the base type is returned. I've modified this method so that it returns instances of the different subtypes depending on the value of a certain column. To make this work I first have to edit the Java files of the subtypes and let them extend the base type instead of the Struct class. The factory method looks like this:
    public static CustomDatumFactory getCustomDatumFactory()
        if (fac == null)
          class facClass implements CustomDatumFactory
            public CustomDatum create(Datum d, int sql_type_code) throws SQLException
              if (d != null)
                BaseType b = new BaseType(d);
                if ("subtype1".equals(b.getType())) b = new SubType1(d);
                else if ("subtype2".equals(p.getType())) b = new SubType2(d);
                else System.err.println("Unknown subtype: " + b.getType());
                return b;
              return null;
          fac = new facClass();
        return fac;
      }I also tried to save several of the subtypes in the database in the attribute field (which is of the base type) using setAttribute, this seems to work out-of-the-box. It seems for now I only get this to work if the object type is saved in a column of a certain table, I can't get it to work (yet) for object type tables (see the other recent topic of mine).
    Is this the correct way to implement what I want? Or is there a better way?
    Regards,
    Peter

  • ERROR: Inconsistent java and sql object types

    I am getting a nested object table in the form of an oracle.sql.ARRAY. I then call getResultSet() on this array and try to cast each object into a Java implementation of the SQLData interface (also defined in the connections type map).
    This approach works for one nested object table but not for another. I get the error message:
    "Inconsistent java and sql object types"
    Does this mean that my Java to Oracle type mappings are wrong? Any help would be appreciated.
    Regards
    Steve

    i had a similar situation. found out it was occuring because the oracle type had not been granted to the appropriate user.
    todd kegley

  • Debugging Oracle Object types

    Hi
    I'm trying to debug a application (in 9i Release 2) using PL/SQL object types and was wondering if JDev can help.
    I can see the objects, and their code, but the debugger seems unable to step into them, see local variables etc. It also incorrectly identifies code errors -- in short it appears to be using the 9i Release 1 drivers.
    I've just installed version 9.0.3.2 but that hasn't helped. The release notes say helpfully that 9.0.3 can handle the drivers for 9i R2, but it won't use them!
    I'm about to try the 10g preview, but I'm not feeling hopeful. Is this something I can expect to be fixed or do I have to find some other way of debugging my code?
    Thanks,
    Glenn.

    Hi,
    I also have problems debugging oracle objects. I'm running an Oracle Database Version 9.2.0.1.0 and use
    JDeveloper 9.0.3 to remotely debug PL/SQL Code. The debugging works fine when I'm setting breakpoints and
    step through the code.
    But I seem to be unable to list the value of variables of
    object types and variables of nested table types. And of course I cannot set conditional breakpoints on variables that have an Oracle object type. If I try 10g, there is no improvement. The object types are not recognized as Oracle object types or nested table types, instead they are shown as $Oracle.builtin.OPAQUE
    I need this feature to remotely debug procedures, that mostly use Oracle object types as parameters. Is there any possibility that I can get this feature to work? Otherwise JDeveloper is not much of a use for me when I'm debugging PL/SQL code.
    Thanks,
    Astrid
    I provided an example, in which I create the above mentioned types and fill them with data, but where I'm unable to retrieve the values of the variables in JDeveloper:
    ---------------------EXAMPLE--------------------------
    PROMPT Creating TYPE 'ot_hwemployee'
    CREATE OR REPLACE TYPE ot_hwemployee AS OBJECT (
    emp_id NUMBER (10),
    emp_name VARCHAR2 (200)
    PROMPT Creating TYPE 'nt_hwemployee'
    CREATE OR REPLACE TYPE nt_hwemployee AS TABLE OF ot_hwemployee
    PROMPT Creating TYPE 'nt_hwinteger'
    CREATE OR REPLACE TYPE nt_hwinteger AS TABLE OF NUMBER (20)
    PROMPT Creating PROCEDURE 'checkEmployees'
    CREATE OR REPLACE PROCEDURE checkEmployees
    AS
    vnt_employees nt_hwemployee;
    BEGIN
    vnt_employees := nt_hwemployee(ot_hwemployee(1, 'Mustermann Max'),
    ot_hwemployee(2, 'Beispiel Barbara'),
    ot_hwemployee(3, 'Schober-Gant Astrid'));
    deleteemployees(vnt_employees);
    END checkEmployees;
    PROMPT Creating PROCEDURE 'deleteEmployees'
    CREATE OR REPLACE PROCEDURE deleteEmployees (
    pnt_employees IN OUT nt_hwemployee)
    AS
    vnt_employees_deleted nt_hwinteger;
    BEGIN
    vnt_employees_deleted := nt_hwinteger();
    FOR i IN pnt_employees.FIRST .. pnt_employees.LAST LOOP
    IF (pnt_employees(i).emp_id > 2) THEN
    vnt_employees_deleted.EXTEND;
    vnt_employees_deleted(vnt_employees_deleted.COUNT) := pnt_employees(i).emp_id;
    pnt_employees.delete(i);
    END IF;
    END LOOP;
    END deleteEmployees;
    -------------------------END EXAMPLE-------------------

  • The java and sql object type  was not matched

    My table(Oracle10.2) has a varying arrays column. For mapping to java classes, I use JDeveloper(10.1.3.1.0) to generate java classes. Then I try to insert a record into this varrying arrays column with java. While it always complaints java.sql.SQLException.the java and sql object type was not matched. I can not find the reason.
    My java code:
                   StructDescriptor structdesc = StructDescriptor.createDescriptor(
                             "VARRAY_SEQ", con);
                   int nid=20;
                   int pid=546;
                   BigDecimal mynid=new BigDecimal(nid);
                   mynid=mynid.setScale(0, BigDecimal.ROUND_HALF_UP);
                   BigDecimal mypid=new BigDecimal(pid);
                   mypid=mypid.setScale(0, BigDecimal.ROUND_HALF_UP);
                   Object[] attributes = { "ASDF", mynid, "Developer", mypid,
                             "rwretw" };
                   STRUCT Rel = new STRUCT(structdesc, con, attributes);
                   stmt.setObject(8, Rel);
                   stmt.execute();
                   stmt.close();
    And the STRUCT is
    public RelSeq(String nucl, java.math.BigDecimal neId, String nuor, java.math.BigDecimal pId, String phor) throws SQLException
    { _init_struct(true);
    setNucl(nucl);
    setNeId(neId);
    setNuor(nuor);
    setPId(pId);
    setPhor(phor);
    }

    My table(Oracle10.2) has a varying arrays column. For mapping to java classes, I use JDeveloper(10.1.3.1.0) to generate java classes. Then I try to insert a record into this varrying arrays column with java. While it always complaints java.sql.SQLException.the java and sql object type was not matched. I can not find the reason.
    My java code:
                   StructDescriptor structdesc = StructDescriptor.createDescriptor(
                             "VARRAY_SEQ", con);
                   int nid=20;
                   int pid=546;
                   BigDecimal mynid=new BigDecimal(nid);
                   mynid=mynid.setScale(0, BigDecimal.ROUND_HALF_UP);
                   BigDecimal mypid=new BigDecimal(pid);
                   mypid=mypid.setScale(0, BigDecimal.ROUND_HALF_UP);
                   Object[] attributes = { "ASDF", mynid, "Developer", mypid,
                             "rwretw" };
                   STRUCT Rel = new STRUCT(structdesc, con, attributes);
                   stmt.setObject(8, Rel);
                   stmt.execute();
                   stmt.close();
    And the STRUCT is
    public RelSeq(String nucl, java.math.BigDecimal neId, String nuor, java.math.BigDecimal pId, String phor) throws SQLException
    { _init_struct(true);
    setNucl(nucl);
    setNeId(neId);
    setNuor(nuor);
    setPId(pId);
    setPhor(phor);
    }

  • Oracle JDBC driver and the object types cache

    Hi there,
    Oracle JDBC Developer's Guide and Reference says (version 11gR1):
    Oracle JDBC drivers cache array and structure descriptors. This provides enormous performance benefits. However, it means that if you change the underlying type definition of a structure type in the database, the cached descriptor for that structure type will become stale and your application will receive a SQLException exception.http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/oraoot.htm#g1104293
    That is the problem we are having here... We have web services deployed to WebLogic server that use custom object types. Every time we have to change an object type definition the web services stop working (the error ORA-00902: invalid datatype is raised) and the only solution is to restart the JDBC data source which is quite disruptive to the development process.
    Is there a workaround to disable that "feature"?
    Thanks
    Luis

    Luis Cabral wrote:
    jschell wrote:
    Although if you are changing the object structure then the code to deal with it must change as well. So, especially in developement, why is restarting a problem?It is not that restarting per se is a problem. Here us developers do not have the required privileges to restart the JDBC pool and we have to ask the DBA to do it, and sometimes he is not immediately available. It is not a big thing but this can impact the development process.Your development process is hideously flawed then.
    The pool exists in the JEE server. And from your first post it seems that you have permission to restart that but not to access the management console. It is ridiculous to have access the the former and not the later.
    Not to mention that you should have your own JEE instance to develop on. Actually it is weird to me that a DBA would even be touching a JEE server. The competent ones I know don't even know how to do that. They know the database not the application servers.
    >
    In addition, having to restart a whole JDBC pool just because you changed a database object definition does not seem very flexible to me. Such issue does not exist in other connection types, for instance in OCI connections, that is why I thought there should be an option to turn it off if required.
    Well specifically you have to restart the pool because you were USING the object that changed.
    And I am rather certain that you can turn off the pool entirely.
    Even in production, I reckon that this may have a negative impact. For instance, say that you need to deploy a hot fix for a bug in one application that involves the re-creation of one single object type. This means that the whole JDBC pool, which may be used by other applications, may have to be shut down just because of that single object.Good point.
    I suggest you stop using complex objects in Oracle. I suspect that would eliminate the problem completely.

Maybe you are looking for

  • How to go from movie to pdfs and back to movie - gracefully

    Hi All, I followed Hunt's instructions for how to burn pdfs to folder and burn that folder and VIDEO_TS folder to disc and it worked great. Now I need to know how to gracefully move viewer from movie to pdf folder.  I inserted a Stop marker that take

  • How do I stop a URL going to InternetExplorer every time?

    For some pages I have once indicated to open them in IE, but now I want to stop this feature for some of these pages. How?

  • Frozen ipod touch 5 Gen

    How do I sync and then restore my ipod touch 5 Gen if my screen is frozen?

  • Mail templates in Tiger?

    Is there any way to customize stationery or make a template in Tiger mail? As in colors, pics, to add in? I see there is a new thing in iMail for Leopard, but wondering about something like that for Tiger. Thanks.

  • NI 9237

    Please help us with to setup NI 9237 and NI 9411 with NI cDAQ-9174  to measure the load, torque and angle at the same time. We are using RJ 50 for the connection between load and torque sensors to NI 9237. For the Load cell, we wired positive and neg