Project

General

Profile

Bug #4977

Temp Table with P.L.O field

Added by Marian Edu over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:

History

#1 Updated by Greg Shah over 3 years ago

  • Description updated (diff)

From Marian:

There are some issues when trying to pass a temp-table as parameter if it contains at least one P.L.O field in it. The ASM class loader used for each instance can't find the object class.

The getter/setter for the field in table definition looks ok (object), however while assigning a value to the field does use the setter method when I want to access the field value it goes through the FieldReference.getValue method which returns a BaseDataType so it fails to compile. Maybe the P.L.O support in temp-tables is not yet complete.

The stack trace below, tried to isolate that in a simple test - table/parameter/test_plo.p.

Caused by: java.lang.NoClassDefFoundError: object<? extends _BaseObject_>
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
        at java.lang.Class.privateGetPublicMethods(Class.java:2902)
        at java.lang.Class.getMethods(Class.java:1615)
        at com.goldencode.p2j.persist.orm.DmoMeta.<init>(DmoMeta.java:272)
        at com.goldencode.p2j.persist.orm.DmoMetadataManager.registerDmo(DmoMetadataManager.java:195)
        at com.goldencode.p2j.persist.DynamicTablesHelper.createDynamicDMO(DynamicTablesHelper.java:679)
        at com.goldencode.p2j.persist.TempTableBuilder.tempTablePrepareImpl(TempTableBuilder.java:2372)
        at com.goldencode.p2j.persist.TempTableBuilder.tempTablePrepare(TempTableBuilder.java:2264)
        at com.goldencode.p2j.persist.TempTableBuilder.tempTablePrepare(TempTableBuilder.java:2440)
        at com.goldencode.p2j.persist.AbstractTempTable.copyTempTable(AbstractTempTable.java:383)
        at com.goldencode.p2j.persist.AbstractTempTable.copyTempTable(AbstractTempTable.java:330)
        at com.goldencode.p2j.persist.TemporaryBuffer.createDynamicTable(TemporaryBuffer.java:2169)
        at com.goldencode.p2j.persist.TemporaryBuffer.createDynamicTable(TemporaryBuffer.java:2095)

#2 Updated by Greg Shah over 3 years ago

  • Assignee set to Constantin Asofiei

#3 Updated by Constantin Asofiei over 3 years ago

  • % Done changed from 0 to 100
  • Status changed from New to WIP

Fixed in 3821c rev 11731

Marian, you can use this patch with your WIP branch:

=== modified file 'rules/schema/dmo_common.rules'
--- rules/schema/dmo_common.rules       2020-09-24 23:43:08 +0000
+++ rules/schema/dmo_common.rules       2020-10-21 13:09:38 +0000
@@ -132,6 +132,7 @@
 **     IAS 20200809          Added support for the field DECIMALS, DESCRIPTION, CASE-SENSITIVE, and 
 **                           MAX-WIDTH attributes
 ** 060 OM  20200925          Fixed latent issue. adjustDataType() returned null in some cases.
+**     CA  20201021          Fixed runtime conversion of dynamic temp-tables with Progress.Lang.Object fields.
 -->

 <!--
@@ -2081,6 +2082,9 @@
          <return    name="dType"                      type="java.lang.String" />

          <rule>isRuntimeConfig()
+            <rule>dataType.indexOf("&lt;") &gt; 0
+               <action>dataType = dataType.substring(0, dataType.indexOf("&lt;"))</action>
+            </rule>
             <action>package = packages.get(dataType)</action>
             <rule>package != null
                <action>dType = sprintf("%s.%s", package, dataType)</action>

=== modified file 'rules/schema/java_dmo.xml'
--- rules/schema/java_dmo.xml   2020-09-07 16:23:31 +0000
+++ rules/schema/java_dmo.xml   2020-10-21 13:09:25 +0000
@@ -34,6 +34,7 @@
 ** 015 OM  20200108          Moved back the extent support method definition to main interface.
 **                           Dropped support for generation of DMO Impls.
 **     OM  20200610          Generated the _Sequences enum.
+** 016 CA  20201021          Fixed runtime conversion of dynamic temp-tables with Progress.Lang.Object fields.
 -->

 <!--
@@ -147,6 +148,7 @@
       <rule>packages.put('longchar'  , 'com.goldencode.p2j.util')</rule>
       <rule>packages.put('memptr'    , 'com.goldencode.p2j.util')</rule>
       <rule>packages.put('NumberType', 'com.goldencode.p2j.util')</rule>
+      <rule>packages.put('object'    , 'com.goldencode.p2j.util')</rule>
       <rule>packages.put('raw'       , 'com.goldencode.p2j.util')</rule>
       <rule>packages.put('recid'     , 'com.goldencode.p2j.util')</rule>
       <rule>packages.put('rowid'     , 'com.goldencode.p2j.util')</rule>

#4 Updated by Marian Edu over 3 years ago

Constantin Asofiei wrote:

Fixed in 3821c rev 11731

Marian, you can use this patch with your WIP branch:
[...]

Works like a charm Constantin, thanks for that.

#5 Updated by Greg Shah over 3 years ago

  • Status changed from WIP to Closed

Also available in: Atom PDF