Objects with the same exposed names in SQL Server

2
Has anyone any idea what might cause a Mendix model to produce the following kind of SQL Server exception? All I did was open a master-detail view in which Branches are listed belonging to a particular Supplier. Branch and Supplier each derive from Auditable. 2010-03-03 14:51:14.469 ERROR - CONNECTIONBUSRETRIEVE: JDBCDataStore::execRetrieveQuery failed with SQLState: S0001 Message: The objects "audit$auditeventauditable" and "audit$auditeventauditable" in the FROM clause have the same exposed names. Use correlation names to distinguish them. XPathTextGetRequest (depth = -1): //PipsAndSubbies.VATCode[Audit.AuditEventAuditable/Audit.AuditEvent[Audit.AuditEventAuditable/PipsAndSubbies.Supplier[id='281535106252805']]] 2010-03-03 14:51:14.470 ERROR - EXTERNALINTERFACE: A server exception occurred: The objects "audit$auditeventauditable" and "audit$auditeventauditable" in the FROM clause have the same exposed names. Use correlation names to distinguish them. 2010-03-03 14:51:14.469 INFO - COREACTIONMANAGEMENT: Exception occurred in action '[RetrieveAction:: Context:Context() xpath://PipsAndSubbies.VATCode[Audit.AuditEventAuditable/Audit.AuditEvent[Audit.AuditEventAuditable/PipsAndSubbies.Supplier[id='281535106252805']]] should retrieve count:false retrieval schema:com.mendix.connectionbus.retrieve.RetrievalSchema@c420b]', all database changes executed by this action were rolled back
asked
1 answers
2

This is a bug. Did you use the latest version of Mendix, 2.4.6? If true, you can submit an incident with a little test project in MXDN.

However, with a little change of your XPath query, maybe the error does not occur. The nested constructions in the query are not necessary in this query, see query 1. When you search on an associated id, the id attribute and his entity can also be avoid, see the better query 2.

Query 1

//PipsAndSubbies.VATCode
[Audit.AuditEventAuditable/Audit.AuditEvent/
 Audit.AuditEventAuditable/PipsAndSubbies.Supplier/id='281535106252805']

Query 2

//PipsAndSubbies.VATCode
[Audit.AuditEventAuditable/Audit.AuditEvent/
 Audit.AuditEventAuditable='281535106252805']
answered