Project

General

Profile

Bug #7449

unqualified _File buffer must target the first database in the connection list

Added by Constantin Asofiei 11 months ago. Updated 10 months ago.

Status:
Test
Priority:
High
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:

History

#2 Updated by Constantin Asofiei 11 months ago

  • Priority changed from Normal to High

In OpenEdge, when running from command line, like this:

pro -db c:\dbs\db1 -db c:\dbs\db2 -p fmeta.p

a testcases like this for fmeta.p:
message buffer _file:dbname ldbname(1) ldbname(2).

will always show

db1 db1 db2

This means that an unqualified _file buffer references always target the first database in the list.

I've also experimented with the GUI Procedure Editor, and:
  • connected first db1
  • connected second db2
  • ran fmeta.p

and in this case, it shows db2 db1 db2. I don't know why this happens. Is there another list of 'connected databases' in OpenEdge?

In any case, I think we will need to match the command line database order:
  • p2j.cfg.xml schema configuration needs to match exactly this
  • progress.g needs to treat explicitly unqualified meta table names, and resolve them from the first connected database.

#3 Updated by Constantin Asofiei 11 months ago

The assumptions in note #6129-28 and others, where it was found that the last connected database is used I think are wrong. In that example:

connect c:\p2j_test\p2j_test.
do on stop undo, leave:
   run fmeta.p.
end.
disconnect p2j_test.

connect c:\p2j_test\cdp.
do on stop undo, leave:
   run fmeta.p.
end.
disconnect cdp.

connect c:\p2j_test\aaa.
do on stop undo, leave:
   run fmeta.p.
end.
disconnect aaa.

where fmeta.p contains:
message buffer _file:dbname.

you can't run the program without having the .r-code file compiled for fmeta.p.

And, at compile time, the _file buffer in fmeta.p will be hard-linked to the first database in the connection list used to start the COMPILE program, something like this:

mpro -db c:\p2j_test\cdp -db c:\p2j_test\p2j_test -db c:\p2j_test\aaa <program-to-compile-fmeta>.p

I may have missed to compile fmeta.p from the command line, and did it instead from the Procedure Editor, previously.

#4 Updated by Constantin Asofiei 11 months ago

  • % Done changed from 0 to 100
  • Status changed from New to Review
  • Assignee set to Constantin Asofiei

Created task branch 7449a from trunk rev 14630.

The changes are in 7449a rev 14631.

#5 Updated by Greg Shah 11 months ago

Code Review Task Branch 7449a Revision 14631

No objections.

#6 Updated by Greg Shah 11 months ago

You can rebase and merge to trunk.

#7 Updated by Constantin Asofiei 11 months ago

  • Status changed from Review to Test

Branch 7449a was merged to trunk rev 14632 and archived.

#8 Updated by Constantin Asofiei 10 months ago

There is an unintended consequence to these changes. If in p2j.cfg.xml, the standard namespace is not explicitly defined as default="false", then this will be a 'default database' and will be the first one in the list (if the standard namespace is the first one).

Eric, is it OK to ensure that for the standard namespace by default the SchemaConfig$NsConfig.defDb is false?

#9 Updated by Eric Faulhaber 10 months ago

Constantin Asofiei wrote:

Eric, is it OK to ensure that for the standard namespace by default the SchemaConfig$NsConfig.defDb is false?

Yes, that makes sense.

#10 Updated by Constantin Asofiei 10 months ago

Eric Faulhaber wrote:

Constantin Asofiei wrote:

Eric, is it OK to ensure that for the standard namespace by default the SchemaConfig$NsConfig.defDb is false?

Yes, that makes sense.

I've made the change in 7450a rev 14640.

#11 Updated by Alexandru Lungu 10 months ago

  • Related to Feature #7404: Trasform replace-mode into append-mode when target table is empty added

#12 Updated by Alexandru Lungu 10 months ago

  • Related to deleted (Feature #7404: Trasform replace-mode into append-mode when target table is empty)

Also available in: Atom PDF