To test the robustness of the application, Deliberately interrupt the Pro * C program that is normally connected, so as to observe their performance.
The test method is as follows: 1. When compiling the Pro * C application, add cpool = No or cpool = yes to test the different performance of the connection pool and no connection pool; 2. After the application is started, wait for the input and stop the process. 3. query the Session of the test program in the database:
Select*FromV $ sessionWhereProgrampolic'testconnpool.exe '; |
4. Generate the code to kill the session:
Select'Alter system kill session ''' | Sid | ',' | serial # | ''';' FromV $ session WhereProgrampolic'testconnpool.exe '; |
5. Execute the SQL statement to kill the session:
Alter System Kill Session'2017 8 ';..... |
6. Press any key to continue the application execution and view the error message. 7. Try to reconnect when an error occurs. The following are the test results in various cases:
Test Status |
Error code for calling |
Reconnect |
If you do not use a connection pool, use kill session to manually disconnect the connection. |
ORA-00028 your session has been killed |
Yes |
Use the connection pool and kill session to manually disconnect all connections |
ORA-03114: not connected to oralce |
No. The connection pool is damaged and only the process is restarted. This error is displayed when reconnecting: ORA-00022 invalid session ID; Access Denied |
Use the connection pool and kill session to manually disconnect the connection pool. |
No error is reported. It is strange that physical connections are disconnected, and the results are still normal. |
|
Use the connection pool and kill session to manually disconnect non-connection pool connections |
ORA-03114: not connected to oralce |
Yes. |
If the connection pool is not used, disconnect the network cable and restore the network connection. |
ORA-12571: TNS: Packet writer failure |
Yes. This error is caused by a client error. A new session is created after the connection is reconnected, and the old session is still in the session List of oracle. (If the application crashes and restarts frequently, the connection to Oracle may be exhausted) |
Use the connection pool to disconnect the network cable and restore the network connection. |
ORA-12571: TNS: Packet writer failure |
Yes. Oracle re-creates the physical connection of the connection pool, but does not create a new logical connection. |