objectId is ambiguous

I just started getting this error, when trying to query the database using the api in iOS.

error java.lang.RuntimeException: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column ‘objectId’ in order clause is ambiguous

I have updated yesterday to the latest sdk. I am not sure if that is causing the error, or its something on the server side but I have never seen this error before, and I have been using it for a while.

Please let me know how I can resolve this issue.

Regards,

George

Hi George,

The temporary solution is to add the line

query.queryOptions.sortBy = nil;

in your code.

Now we are looking for the cause of this issue, we let you know about a result.

Regards,
Slava

Hi, George.

Please, could you provide the code example of your request. What are you trying to do ? What is your data structure ?

Hi Oleg,

I have a table UserMessage that has two relationships

  1. recipient (which is a user representing the “recipient” user)
  2. message (which is the message that contains the info of the message and also a user reference that represents the “sender” of the message)

And I am trying to load all UserMessage objects where I am the recipient or the sender. The where clause is the following
recipient.objectId = ‘my user id’ or message.sender.objectId = ‘my user id’

This was working just fine, until today.

Regards,

George

Also I found this thread having a similar issue but it was a long time ago.

http://support.backendless.com/t/find-column-created-in-order-clause-is-ambiguous

Regards,

George

Please let me know when you have an update on this issue. Thank you in advance.

Regards,

George

Downgrading from version 3.0.33 to 3.0.32 seems to resolve this issue.
I hope this is helpful.

Regards,

George

Hi George,

Internal ticket has been created for this issue BKNDLSS-13036. We will fix this issue as fast as possible.

Regards,

Denys

George, please provide your appId here or to support@backendless.com, we will investigate this issue with your data. Also give us your code which retrieves UserMessage objects with whereClause.

Hi Slava, any update on this issue?

Regards,

George

Hi Slava,Denys

where you able to access my data and figure out what is causing this issue?
Thank you in advance.

Regards,

George

The internal task BKNDLSS-13036 yet has “in Progress” status.

after updating to 3.0.41 got same issue.
this helped:

 temporary solution is to add the line
query.queryOptions.sortBy = nil;