See the original issue in this thread:
Mysterious ORA-00933 on startup when using ODAC unmanaged/managed
Short version:
random ORA-00933 SQL command not properly ended on application startup.
When the error happens the generated command always ends with a double where clause and the second clause is "WHERE (ROWNUM <= (1) )"
It seems I found the root cause of the issue: when two independent commands are being generated on separate threads and one of them contains a DbLimitExpression the other command may borrow this fragment. This indicates some static variable is used during query generation that should be a context variable. This behavior seems to be present in both managed and unmanaged ODAC.
I'm mostly seeing this on startup because my startup queries are the most likely to run in parallel and one of them uses OrderBy then FirstOrDefault which seem to trigger the use of the shared state. After removing the FirstOrDefault() from this query I haven't seen this bug triggered yet.
For performance reasons I obviously cannot strip FirstOrDefault calls from all of my queries, nor can I set a global lock to serialize query generation. Is there a more suitable workaround?
@"2796195" could you verify?