3 Replies Latest reply on Oct 17, 2008 2:34 AM by 665676

    Internal Error: Inconsistent catalog view

    469411

      I tried to pass data from java code into database using table object but I got exception error through out.

      java.sql.SQLException: internal error: Inconsistent catalog view
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:158)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
      at oracle.sql.StructDescriptor.initMetaData1_9_0(StructDescriptor.java:2095)
      at oracle.sql.StructDescriptor.initMetaData1(StructDescriptor.java:2034)
      at oracle.sql.StructDescriptor.isInstantiable(StructDescriptor.java:1212)
      at oracle.sql.STRUCT.<init>(STRUCT.java:142)

      In database, there are two user accounts, one is named "usera" and the other is named "userb". All tables, stored procedures, types, objects are created and defined in "usera" and grant them for proper permission to a role and "userb" is with the role.

      Java application connects to database using "userb".

      The object types I defined in "usera" are as below.

      ======= Type defined in database =======

      CREATE OR REPLACE TYPE om_tp_svc_item_obj AS OBJECT
      (
      SVC_ITEM VARCHAR2(5),
      ACTION_CDE VARCHAR2(1)
      );

      CREATE TYPE om_tp_svc_item_tbl AS TABLE OF OM_TP_SVC_ITEM_OBJ


      ======= My java code is as below =======

      StructDescriptor structDescriptor = null;
      ArrayDescriptor arrayDescriptor = null;
      VaServiceVO vaServiceValue = null;

      try {
      structDescriptor = StructDescriptor.createDescriptor("OM_TP_SVC_ITEM_OBJ", conn);
      arrayDescriptor = ArrayDescriptor.createDescriptor("OM_TP_SVC_ITEM_TBL", conn);

      Object[] object = new Object[structDescriptor.getLength()];

      Object[] objTable = new Object[itemList.size()];

      for(int i=0; i<itemList.size(); i++)
      {
      vaServiceValue = (VaServiceVO) itemList.get(i);

      object[0] = vaServiceValue.getServiceCode();
      object[1] = statusCode;

      objTable[i] = new STRUCT(structDescriptor, conn, object);
      }
      return new ARRAY(arrayDescriptor, conn, objTable);
      } catch ( SQLException sqle) {
      throw sqle;
      }


      If those two type objects are created in the user account "userb" then there is no error and the process can be done without problem. However, I can't use this way on our application because of restriction by DBA requirement.

      Is there any solution that can resolve my problem? Thanks.