Re: [cx-oracle-users] How to induce "ORA-03114: Not Connected to Oracle"?
Brought to you by:
atuining
From: Christopher J. <chr...@or...> - 2019-01-16 00:43:08
|
On 14/1/19 8:34 pm, Piotr Dobrogost wrote: > Hi all! > > How can I induce ORA-03114 in cx_Oracle for the purpose of testing application behavior? > > I tried blocking network traffic after the connection has been established but this resulted in cx_Oracle (I guess) waiting for a response from the > server and after a couple of minutes I gave up. Strangely it seems like there are no timeouts in this situation. > > I guess inducing ORA-03114 might require closing all connections (I'm using connection pool in SQLAlchemy) and then somehow preventing new ones from > establishing? > > Best regards, > Piotr Dobrogost > That's not such a common request... What are you trying to test? Are you using a session pool? Regarding timeouts, there are Oracle Net parameters you can put in a sqlnet.ora file (on the machine where cx_Oracle is), such as SQLNET.SEND_TIMEOUT, SQLNET.RECV_TIMEOUT and SQLNET.OUTBOUND_CONNECT_TIMEOUT e.g. https://docs.oracle.com/en/database/oracle/oracle-database/18/netrf/parameters-for-the-sqlnet-ora-file.html#GUID-0857C817-675F-4CF0-BFBB-C3667F119176 If you want to generate an error, does it have to be ORA-3114? To generate various connection failures you can kill the Oracle DB server process, or set the above parameters. Chris -- http://twitter.com/ghrd |