Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Race condition in ODAC causes ORA-00933 command text corruption

Greg BachratyJun 1 2015 — edited Jul 2 2015

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?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 30 2015
Added on Jun 1 2015
1 comment
5,639 views