Tuesday, March 19, 2013

Issue with First Transient Attribute in ADF BC Entity Object

There is one interesting bug reproduced across all ADF versions - related to the order of attributes in ADF BC Entity Object. Specifically to the order of transient attributes within the Entity Object attributes list. If transient attribute is set as a first attribute in the Entity Object - it will break, when trying to commit transaction. SQL Select for Update executed from Entity Object will fail, because ADF BC includes invalid comma for the transient attribute defined in the Entity.

Here is the case - add transient attribute to the EO and make sure it is set as first in the list:


Now add the same attribute from EO to VO (field order in VO is not important):


Transient attribute is created in the EO, VO SQL includes only DB column fields - this is correct:


However, when you run such VO, change data and try to commit - will get error about wrong select:


In the log we can see that SQL statement is corrupted - there is comma before the first attribute:


You can fix this error, by moving first transient attribute lower in the list:


SQL Select works well with the fix above applied:


Here you can download working sample application - FirstTransientApp.zip.

2 comments:

  1. Great Andrejus. Now I got to know the reason why mostly we place Transient attributes at the bottom of EO.

    Thanks for sharing.

    ReplyDelete