adfemg
  1. adfemg
  2. ADFEMG-83

JDev 11.1.2.3.0: ADFbc Model created with type map "Java extended for Oracle" produce wrong SQL for insert/update of specific NUMBER types

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Labels:
      None
    • Environment:

      Win7/64; ORacle DB 11.2.0.1; JDev 11.1.2.3.0

      Description

      Creating a ADFbc model with type map "Java extended for Oracle" (the default for new ADFbc projects using 11.1.2.3.0) using a table whit NUMBER database types
      creates an ADFbc EO with BigInteger data type. This behavior depends on the database NUMBER type precision:
      NUMBER(16,0) -> Long
      NUMBER(20,0) -> BigInteger
      NUMBER(22,0) -> BigInteger
      NUMBER(38,0) -> BigInteger
      If a table in the DB has columns of one of the types above the ADFbc wizzard 'Business Component from Tables' the resulting EO attributes are mappet to the BigInteger java type. However, when the model project is tested with the bc model tester (debug the application module) you can't insert or update data in the attributes mapped to BigInteger. Trying to commit such a row results in the following stack trace:

      [82] Built select: 'SELECT ID, NUM1, NUM2, NUM3, NUM4 FROM NUMTEST Numtest'
      [83] Executing LOCK...SELECT ID, NUM1, NUM2, NUM3, NUM4 FROM NUMTEST Numtest WHERE ID=:1 FOR UPDATE NOWAIT
      [84] Where binding param 1: 1
      [85] OracleSQLBuilder Executing, Lock 2 DML on: NUMTEST (Update)
      [86] UPDATE buf Numtest>#u SQLStmtBufLen: 210, actual=46
      [87] UPDATE NUMTEST Numtest SET NUM2=:1 WHERE ID=:2
      [88] Update binding param 1: 3
      [89] OracleSQLBuilderImpl.doEntityDML failed...
      [90] X/Open SQL State is: 99999
      [91] java.sql.SQLException: Invalid column type
      at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:11256)
      at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:10605)
      at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:11665)
      at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:11631)
      at oracle.jdbc.driver.OraclePreparedStatementWrapper.setObject(OraclePreparedStatementWrapper.java:253)
      at oracle.jbo.server.OracleSQLBuilderImpl.bindUpdateStatement(OracleSQLBuilderImpl.java:2194)
      at oracle.jbo.server.EntityImpl.bindDMLStatement(EntityImpl.java:10474)
      at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:415)
      at oracle.jbo.server.EntityImpl.doDML(EntityImpl.java:8518)
      at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6775)
      at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3264)
      at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:3067)
      at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2071)
      at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2352)
      at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(DCJboDataControl.java:1590)
      at oracle.adf.model.binding.DCDataControl.callCommitTransaction(DCDataControl.java:1415)
      at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1428)
      at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2169)
      at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:731)
      at oracle.jbo.uicli.jui.JUActionBinding.actionPerformed(JUActionBinding.java:193)
      at oracle.jbo.uicli.controls.JUNavigationBar.doAction(JUNavigationBar.java:412)
      at oracle.jbo.jbotester.NavigationBar.doAction(NavigationBar.java:112)
      at oracle.jbo.uicli.controls.JUNavigationBar$NavButton.actionPerformed(JUNavigationBar.java:118)
      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
      at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
      at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
      at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
      at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
      at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
      at java.awt.Component.processMouseEvent(Component.java:6289)
      at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
      at java.awt.Component.processEvent(Component.java:6054)
      at java.awt.Container.processEvent(Container.java:2041)
      at java.awt.Component.dispatchEventImpl(Component.java:4652)
      at java.awt.Container.dispatchEventImpl(Container.java:2099)
      at java.awt.Component.dispatchEvent(Component.java:4482)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
      at java.awt.Container.dispatchEventImpl(Container.java:2085)
      at java.awt.Window.dispatchEventImpl(Window.java:2478)
      at java.awt.Component.dispatchEvent(Component.java:4482)
      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
      at java.awt.EventQueue.access$000(EventQueue.java:85)
      at java.awt.EventQueue$1.run(EventQueue.java:603)
      at java.awt.EventQueue$1.run(EventQueue.java:601)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
      at java.awt.EventQueue$2.run(EventQueue.java:617)
      at java.awt.EventQueue$2.run(EventQueue.java:615)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

      [92] OracleSQLBuilder: ROLLBACK WORK TO SAVEPOINT 'BO_SP'
      [93] DCBindingContainer.reportException :oracle.jbo.DMLException
      [94] oracle.jbo.DMLException: JBO-26041: Failed to post data to database during "Update": SQL Statement "UPDATE NUMTEST Numtest SET NUM2=:1 WHERE ID=:2".
      at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:581)
      at oracle.jbo.server.EntityImpl.doDML(EntityImpl.java:8518)
      at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6775)
      at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3264)
      at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:3067)
      at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2071)
      at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2352)
      at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(DCJboDataControl.java:1590)
      at oracle.adf.model.binding.DCDataControl.callCommitTransaction(DCDataControl.java:1415)
      at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1428)
      at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2169)
      at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:731)
      at oracle.jbo.uicli.jui.JUActionBinding.actionPerformed(JUActionBinding.java:193)
      at oracle.jbo.uicli.controls.JUNavigationBar.doAction(JUNavigationBar.java:412)
      at oracle.jbo.jbotester.NavigationBar.doAction(NavigationBar.java:112)
      at oracle.jbo.uicli.controls.JUNavigationBar$NavButton.actionPerformed(JUNavigationBar.java:118)
      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
      at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
      at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
      at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
      at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
      at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
      at java.awt.Component.processMouseEvent(Component.java:6289)
      at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
      at java.awt.Component.processEvent(Component.java:6054)
      at java.awt.Container.processEvent(Container.java:2041)
      at java.awt.Component.dispatchEventImpl(Component.java:4652)
      at java.awt.Container.dispatchEventImpl(Container.java:2099)
      at java.awt.Component.dispatchEvent(Component.java:4482)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
      at java.awt.Container.dispatchEventImpl(Container.java:2085)
      at java.awt.Window.dispatchEventImpl(Window.java:2478)
      at java.awt.Component.dispatchEvent(Component.java:4482)
      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:644)
      at java.awt.EventQueue.access$000(EventQueue.java:85)
      at java.awt.EventQueue$1.run(EventQueue.java:603)
      at java.awt.EventQueue$1.run(EventQueue.java:601)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
      at java.awt.EventQueue$2.run(EventQueue.java:617)
      at java.awt.EventQueue$2.run(EventQueue.java:615)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:614)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
      Caused by: java.sql.SQLException: Invalid column type
      at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:11256)
      at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:10605)
      at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:11665)
      at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:11631)
      at oracle.jdbc.driver.OraclePreparedStatementWrapper.setObject(OraclePreparedStatementWrapper.java:253)
      at oracle.jbo.server.OracleSQLBuilderImpl.bindUpdateStatement(OracleSQLBuilderImpl.java:2194)
      at oracle.jbo.server.EntityImpl.bindDMLStatement(EntityImpl.java:10474)
      at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:415)
      ... 52 more

        1. Detail 0 ##

      The following sql was used to create the table :
      CREATE TABLE "NUMTEST"
      ("ID" NUMBER(38,0) NOT NULL ENABLE,
      "NUM1" NUMBER(16,0),
      "NUM2" NUMBER(20,0),
      "NUM3" NUMBER(22,0),
      "NUM4" NUMBER(30,0),
      CONSTRAINT "NUMTEST_PK" PRIMARY KEY ("ID")
      );

      The sample workspace can be downloaded from http://tompeez.files.wordpress.com/2013/01/numtest-zip.doc
      Please rename the file back to numtest.zip before unzipping it.

      Using BigDecimal instead of BigInteger resolves the issue. However, this has to be done by hand for every BigInteger java type. In the sample the ID and the NUM4 column are mapped to BigDecimal by hand to make the sample run at all (as the ID column is the PK).

        Activity

        Hide
        chriscmuir added a comment -

        [Informational update only - no action required]

        JDBC experimental patch arrived today and I tested this on 11.1.2.3.0, it removes the immediate problem.

        Now working with internal teams to ensure the patch is migrated/made available for the integrated WLS with JDev.

        As such this update is for your information to show progress, however please await further updates.

        CM.

        Show
        chriscmuir added a comment - [Informational update only - no action required] JDBC experimental patch arrived today and I tested this on 11.1.2.3.0, it removes the immediate problem. Now working with internal teams to ensure the patch is migrated/made available for the integrated WLS with JDev. As such this update is for your information to show progress, however please await further updates. CM.
        Hide
        chriscmuir added a comment -

        [Information update only - no action required]

        JDBC code has been merged into 12.1.2 WLS code tree, and the JDBC drivers are now undergoing extensive regression testing by QA teams. I'm awaiting their positive signal so I can continue my testing.

        As such this update is for your information to show progress, however please await further updates.

        CM.

        Show
        chriscmuir added a comment - [Information update only - no action required] JDBC code has been merged into 12.1.2 WLS code tree, and the JDBC drivers are now undergoing extensive regression testing by QA teams. I'm awaiting their positive signal so I can continue my testing. As such this update is for your information to show progress, however please await further updates. CM.
        Hide
        chriscmuir added a comment -

        Tested in 12.1.2 public release and issue appears to be complete. Please verify and close the EMG issue if you agree.

        Thanks,

        CM.

        Show
        chriscmuir added a comment - Tested in 12.1.2 public release and issue appears to be complete. Please verify and close the EMG issue if you agree. Thanks, CM.
        Hide
        chriscmuir added a comment -

        No further update, closing issue.

        CM.

        Show
        chriscmuir added a comment - No further update, closing issue. CM.
        Hide
        Timo_Hahn added a comment -

        Ups, this slipped my to do list. Works for me in 12.1.2

        Timo

        Show
        Timo_Hahn added a comment - Ups, this slipped my to do list. Works for me in 12.1.2 Timo

          People

          • Assignee:
            Unassigned
            Reporter:
            Timo_Hahn
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: