a.m.sidorenko wrote:Yes, we do so. When a pipeline catches an exception it finishes processing the request and sends a response to a client with an error message.
You can also execute the static method ClearAllPools(true) to clear pools. If a session was killed, connections in the pool are invalid. ClearAllPools deletes connections that are in the pool. However, the connections that were open when the method was called aren’t deleted, and will be returned to the pool even if they are invalid. For more information, please refer to
https://www.devart.com/dotconnect/oracl ... lean).html
a.m.sidorenko wrote:Sadly it was impossible to try "Validate Connection" setting as the app's performance became worse in 4 times.
Validate connection performs validation each time when a connection is taken from the pool. If connection is not valid, it is closed. This verification takes additional time and decreases performance. If you open a connection often, performance may be impaired. However, in this case you will be sure that a valid connection is open.
a.m.sidorenko wrote:Also, I tried to lower down "Connection Lifetime" setting from 30 to 2 minutes but looks like this caused another performance problem
When you use "Connection Lifetime=120" connection string parameters, it means that connection would be deleted instead of placing to the pool when it is closed if it was created more then 2 minutes ago. As for the issue with session killing, this option won’t help you, but performance will be decreased.
At the moment we can see two situations:
1. You have the Max Pool Size = 140. For example you have already opened 100 connections. When issue with a session occurs 100 connections became invalid. You handle errors generated in your code after this and close connections. These connections are returned to the pool. Then you open another 100 connections. These connections are taken from the pool, but they are invalid, and connection opening takes time. You initialize another 100 threads that open a connection each. 40 connections are opened and other 60 wait while connection timeout is reached. If connection timeout equals to 0 then the connection freezes forever. In this situation "Validate connection" can help, but performance will be decreased in other situations.
2. You have reached Max Pool Size value without the session issue. In this case a thread will wait until some other thread frees a connection. In this case you need to increase Max Pool Size value or open less connections at the same time.