Issue Details (XML | Word | Printable)

Key: ADFEMG-132
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Jan Vervecken
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
adfemg

difference when configuring type DBSequence during wizard or afterwards

Created: 20/May/13 02:34 PM   Updated: 18/Oct/13 08:28 AM   Resolved: 18/Oct/13 08:28 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Tags:
Participants: chriscmuir and Jan Vervecken


 Description  « Hide

hi

Using JDeveloper 11.1.2.4.0 there seems to be a significant difference in Entity Object attribute meta-data and run-time behaviour when type DBSequence is configured for an attribute during the Create Entity Object wizard or afterwards.

Please consider the example application created using JDeveloper 11.1.2.4.0
at http://www.consideringred.com/files/oracle/2013/DBSequenceEOAttrApp-v0.01.zip

It has the following Entity Objects for the HR.EMPLOYEES table :

  • EmpWizDBSeq : for this Entity Object the type DBSequence is configured for the EmployeeId attribute during the Create Entity Object wizard
  • EmpWizInt : for this Entity Object the type DBSequence is configured for the EmployeeId attribute after completing the Create Entity Object wizard
  • EmpWizIntDefVal : the same as EmpWizInt but with DefaultValue="@0" copied from EmpWizDBSeq using the Entity Object editor source tab

The observed run-time behavour for these View Objects based on the above Entity Objects :

  • EmpWizDBSeqVO : the EmployeeId attribute automatically gets a unique negative number value for a new row
  • EmpWizIntVO : the EmployeeId attribute remains empty for a new row
  • EmpWizIntDefValVO : the EmployeeId attribute automatically gets a unique negative number value for a new row

see also the screencast at http://screencast.com/t/1VB68PxhPfZg

About the "unique negative number", see also documentation section "4.10.10 How to Get Trigger-Assigned Primary Key Values from a Database Sequence"
at http://docs.oracle.com/cd/E37975_01/web.111240/e16182/bcentities.htm#ADFFD19777

Can the behaviour described above be reproduced?
How can the meta-data differences be explained, between Entity Object attributes that have type DBSequence configured during the Create Entity Object wizard, and Entity Object attributes that have type DBSequence configured after completing the Create Entity Object wizard?
How can (using JDeveloper 11.1.2.4.0) an existing Entity Object attribute be properly configured for type DBSequence (without making modifications on the source tab)?

many thanks
Jan Vervecken



Jan Vervecken added a comment - 20/May/13 02:36 PM

The meta-data for the Entity Object attributes
in http://www.consideringred.com/files/oracle/2013/DBSequenceEOAttrApp-v0.01.zip :

  • EmpWizDBSeq :
      <Attribute
        Name="EmployeeId"
        IsUpdateable="while_insert"
        DefaultValue="@0"
        Precision="6"
        Scale="0"
        ColumnName="EMPLOYEE_ID"
        SQLType="NUMERIC"
        Domain="oracle.jbo.domain.DBSequence"
        Type="oracle.jbo.domain.DBSequence"
        ColumnType="NUMBER"
        TableName="HR.EMPLOYEES"
        PrimaryKey="true"
        RetrievedOnInsert="true"/>
    
  • EmpWizInt :
      <Attribute
        Name="EmployeeId"
        IsNotNull="true"
        Precision="6"
        Scale="0"
        ColumnName="EMPLOYEE_ID"
        SQLType="NUMERIC"
        Type="oracle.jbo.domain.DBSequence"
        ColumnType="NUMBER"
        TableName="HR.EMPLOYEES"
        PrimaryKey="true"/>
    
  • EmpWizIntDefVal :
      <Attribute
        Name="EmployeeId"
        IsNotNull="true"
        DefaultValue="@0"
        Precision="6"
        Scale="0"
        ColumnName="EMPLOYEE_ID"
        SQLType="NUMERIC"
        Type="oracle.jbo.domain.DBSequence"
        ColumnType="NUMBER"
        TableName="HR.EMPLOYEES"
        PrimaryKey="true"/>
    

    This JIRA issue ADFEMG-132 is somewhat related to OTN forum thread "Why sum field in master VO didnot change when a new row add in detail VO?"
    at https://forums.oracle.com/forums/thread.jspa?threadID=2529569


chriscmuir added a comment - 29/May/13 03:11 AM

Thanks for logging this Jan.

At this stage I can't replicate the issue. In creating the Employees EO via the EO wizard, then editing the EmployeesId attribute via the EO editor I see this:

<Attribute
Name="EmployeeId"
Precision="6"
Scale="0"
ColumnName="EMPLOYEE_ID"
SQLType="NUMERIC"
Type="oracle.jbo.domain.DBSequence"
ColumnType="NUMBER"
TableName="HR.EMPLOYEES"
PrimaryKey="true"
IsUpdateable="while_insert"
DefaultValue="@0"
Domain="oracle.jbo.domain.DBSequence"
RetrievedOnInsert="true"/>

What am I doing wrong?


Jan Vervecken added a comment - 29/May/13 06:34 PM

Thanks for your reply Chris and for trying to reproduce this.

  • about "What am I doing wrong?"

regards
Jan Vervecken


chriscmuir added a comment - 30/May/13 03:04 AM

Thanks Jan, that makes it crystal clear, I didn't know there was a right-mouse-context-menu option to change the type. I've replicated the issue and raised bug 16882038 as a result.

CM.


Jan Vervecken added a comment - 30/May/13 12:27 PM

Thanks for your reply Chris.

  • about "... I've replicated the issue ..."
    • Thank you for the confirmation.
  • about "... raised bug 16882038 as a result ..."
    • On My Oracle Support I have been able to find bug 16882038, "CHANGING EO ATTR TYPE TO DBSEQUENCE CREATES WRONG DT & RT BEHAVIOUR".
      This bug 16882038 currently does not have a published comment with a reference to this JIRA issue ADFEMG-132 .

The Problem Description in bug 16882038 mentions "3 ways to set the attribute type".
One way is via the type droplist on the Details tab for a selected attribute on the Attributes tab in an Entity Object editor, which allows the EmpWizInt attribute EmployeeId to be changed from

  <Attribute
    Name="EmployeeId"
    IsNotNull="true"
    Precision="6"
    Scale="0"
    ColumnName="EMPLOYEE_ID"
    SQLType="NUMERIC"
    Type="oracle.jbo.domain.DBSequence"
    ColumnType="NUMBER"
    TableName="HR.EMPLOYEES"
    PrimaryKey="true"/>

to

  <Attribute
    Name="EmployeeId"
    ColumnName="EMPLOYEE_ID"
    SQLType="INTEGER"
    Type="oracle.jbo.domain.DBSequence"
    ColumnType="NUMBER"
    TableName="HR.EMPLOYEES"
    PrimaryKey="true"
    IsUpdateable="while_insert"
    DefaultValue="@0"
    Domain="oracle.jbo.domain.DBSequence"
    RetrievedOnInsert="true"/>

This answers one of my initial questions, about how (using JDeveloper 11.1.2.4.0) an existing Entity Object attribute can be properly configured for type DBSequence.

regards
Jan Vervecken


chriscmuir added a comment - 31/May/13 12:13 AM

As update dev has replicated in 12.1.3 and is now putting priority on a fix.


chriscmuir added a comment - 15/Jul/13 02:38 AM

Dev has detected that there was two code paths that had got out of sync, and the mechanism you discovered here is the older one. To ensure the issue doesn't occur again they've decided to remove the context menu option as the type can easily be refactored right there in the flat editor anyway.

If I have time I'll verify this change in an internal 12.1.3 build, or otherwise wait until the public release of 12.1.3 to verify.

CM.


chriscmuir added a comment - 18/Oct/13 08:28 AM

Subsequently tested this in an internal 12.1.3 build and I note the Change Type context menu option has been removed as planned, removing the circumstances under which the original bug can occur. This satisfactorily resolves the issue.

Closing bug.