While using output produced by SqlRenderer/Translate, which contained many statements including Global Temp Tables (GTT), we began to notice session locking in Oracle.
I believe this has to do with connection pooling and oracle-specific GTTs. Statements produced by SqlRenderer/Translate use “on commit preserve rows”. From what I’ve read, in Oracle, this should be “on commit delete rows”, so that clean up happens at the transaction level, not the session. Sessions are being reused and I believe this is likely causing the contention we are seeing.
Options include:
- Changing oracle-specific GTT statements within SqlRenderer/Translate
to use “on commit delete rows” – to specify transaction-scoped GTTs. - Changing WebAPI to not use connection pooling and open/close
connection for every operation.
Ideally, we would NOT want to restrict clients of SqlRenderer/Translate from using connection pooling, so what is the feasibility of changing to transaction-scope GTTs vs session?