0 Replies Latest reply on Aug 7, 2012 4:58 PM by 673780

    Migrate OraData Payload to 11g

      We've been using a custom data type as payload for an Oracle advance queue since version 9i. Now we're trying to transition to 11g and I'm coming up with problems using the new API. In the old API, I would enqueue a message as follows:

           MY_OBJECT_TY myObj = new MY_OBJECT_TY();
           myObj.setName("MY name");
           oracle.AQ.AQMessage message = aQQueue.createMessage();
           oracle.AQ.AQObjectPayload payload = message.getObjectPayload();
           oracle.AQ.AQMessageProperty msgProps = message.getMessageProperty();
           msgProps.setCorrelation("My correlation");
           oracle.AQ.AQEnqueueOption enqOption = new AQEnqueueOption();
           aQQueue.enqueue(enqOption, message);

      where MY_OBJECT_TY is a Java class that implements the ORAData and ORADataFactory interface and the Oracle type is described as follows:

      SQL> desc my_object_ty;
      Name Null? Type
      ----------------------------------------- -------- ----------------------------
      NAME VARCHAR2(32)
      BUF VARCHAR2(4000)

      In the new API, I believe I'm supposed to use OracleConnection.enqueue() to enqueue my message, but my problem is constructing the object payload. Could someone provide pointers or code snippets to help accomplish my goal?