Oracle StructDescriptor caching


Performance and scalability: Oracle StructDescriptor caching

  1. Oracle StructDescriptor caching (2 messages)

    Hi, We are currently experienceing a performance hit creating oracle StructDescriptors. These are internally cached by oracle at the connection level so that calling StructDescriptor.createDescriptor(objectName, conn) will use a cached StructDescriptor if one exists against the given connection (the OracleConnection class actually uses putDescriptor() and getDescriptor() to do this). My question is - since we have a connection pool, it will take some time to be "warmed up" such that every connection in the pool has a cached StructDescriptor. I've tried caching the StructDescriptor in another java class and using the same one across multiple connections, this seems to work fine so far - does anyone happen to know if there would be any problems with this approach ? e.g. private StructDescriptor getStructDescriptor(String oracleObjectName, Connection conn) throws SQLException { StructDescriptor retVal = (StructDescriptor) CACHE.get(oracleObjectName); if (retVal == null) { retVal = StructDescriptor.createDescriptor(oracleObjectName, conn); ((oracle.jdbc.driver.OracleConnection) conn).putDescriptor(oracleObjectName, retVal); CACHE.put(oracleObjectName, retVal); } else { System.out.println("Using cached descriptor"); } return retVal; }

    Threaded Messages (2)

  2. Do someone have an answer for this?
  3. Need Input[ Go to top ]

    @Steven Wood, is that approch ("caching descriptors in java"). correct?