I went to the company the day before, and the boss said, "All servers are down!
After troubleshooting for half a day, the conclusion is that memory overflow!
In the was dump log, I was dizzy and finally found the culprit. It turned out that a colleague used a scrollable result set when writing code, leading to memory overflow.
What is a scrollable result set? Actually, it is the resultset cursor. Originally, Oracle does not support the cursor to move up. It can only move down, that is, generally used Rs. next (), but the JDBC interface and driver provide a move-up cursor, which obviously means that the cursor is implemented in Java. I have not read the source code, but I guess, when the cursor moves to the next row, the obtained records are saved to a collection. If you need to call the previous one, you can get the previous data.
This implementation is not controversial, but you should pay attention to the scenario. If you can ensure that your data volume is not large, it is more than enough to store thousands of data records into the collection, however, if you are not sure about the data volume, for example, if you want to export the report data, this report may only contain more than one thousand records, but you do not know how many records, tens of thousands or even millions, storing millions of business data in a list set obviously results in memory overflow !!
Therefore, it is recommended that you do not use a scrollable result set to process business logic that you do not know the amount of data. The price is that the server may be dumped due to memory overflow !!
That is, when constructing a statement object, try not to add
Resultset. type_scroll_insensitive
Resultset. type_scroll_sensitive
These can make the result set scroll!