"ORA-01453: SET TRANSACTION must be first statement of transaction"
I searched for this error and found similar posts, most of them related to either multi-threading issues or concurrent use of several connection. Neither of them is my case, but I've found what causes the problem for me: I have a view that reads data from a different Oracle database. The problem occurs only when there is an attempt to read data from that view from within a transaction created by OData service.
Suggested workaround (wrapping in a transaction scope) did not help.
Any tips are appreciated.
P.S. I managed to extract a small piece of code that triggers this problem:
Code: Select all
var roles = new Roles { Role = Guid.NewGuid().ToString() };
_service.AddEntity(roles);
string progId = Guid.NewGuid().ToString();
int piViewCount = (from p in _service.Entities.PiProgramView where p.ProgId == progId && true select p).Count();
_service.SaveChanges();