1 2 Previous Next 22 Replies Latest reply on Jul 8, 2008 6:34 AM by Chris Muir-Oracle

    JDev 11gTP4 ADF BC bug: new "user untouched" record not inserted on commit

    Chris Muir-Oracle
      Hi JDev team

      I've found somewhat of an obscure bug within ADF BC in JDev 11gTP4.

      Create the following table in the database:
      CREATE TABLE "RCIS"."CHRIS_MUIR_DELETE_ME_1" 
         (     "ID" NUMBER(10,0) PRIMARY KEY,
           "SOME_FIELD" VARCHAR2(100 BYTE) NOT NULL ENABLE,
           "CREATED_ON" DATE,
            PRIMARY KEY ("ID"));
      Now create a Fusion app (ADF BC/JSF), and via the Business Components from Table wizard, create the usual EO/VO/AM combination.

      Open the EO editor and generate the relevant EntityImpl for the table above, as well as the create method.

      In the create method, derive all fields programmatically, such as:
          protected void create(AttributeList attributeList) {
              super.create(attributeList);
              setId(new Number(6));
              setSomeField("fish");
              setCreatedOn(new Date(Date.getCurrentDate()));
          }
      Change the Model project to output the debug diagnostics (-Djbo.debugoutput=console).

      Now open the Business Component Browser, open the relevant VO, select the + button to create a new record (all fields should be populated), DO NOT CHANGE ANY DATA YOURSELF and commit.

      With the debug diags we should see something like this in the log window:
      [386] OracleSQLBuilder: SAVEPOINT 'BO_SP'
      [387] {{ type: 'SQLB_DOENTITYDML' Executing operation : Insert for Entity [oracle.jbo.Key[8 ]]
      [388] OracleSQLBuilder Executing, Lock 1 DML on: CHRIS_MUIR_DELETE_ME_1 (Insert)
      [389] INSERT buf ChrisMuirDeleteMe1>#i SQLStmtBufLen: 255, actual=78
      [390] {{ type: 'JDBC_CREATE_STATEMENT' createPreparedStatement - prefetch size: 1
      [391] }}+++ End Event20 null
      [392] INSERT INTO CHRIS_MUIR_DELETE_ME_1(ID,SOME_FIELD,CREATED_ON) VALUES (:1,:2,:3)
      [393] Insert binding param 1: 6
      [394] Insert binding param 2: fish
      [395] Insert binding param 3: 2008-06-04
      [396] }}+++ End Event19 null
      [397] ChrisMuirDeleteMe1View1 notify COMMIT ...
      ...and in the Business Components Browser be able to requery on this record.

      However because you haven't actually edited any of the fields yourself, what you in fact all you will see is this:
      [386] ChrisMuirDeleteMe1View1 notify COMMIT ... 
      ...and a requery on the record in the Business Components Browser shows the record has not actually hit the database.

      I believe I've also replicated this error in a JSF page, so the problem is not in the Business Components Browser.

      So my usual question to you in my undying love for JDeveloper, am I being stupid as per usual and forgetting something, or is it a genuine bug? ;)

      Regards,

      CM.
        1 2 Previous Next