I have a business service that actively reads data from a remote Postgres database. OnProcessInput opens a XDBC (actually JDBC) connection, executes an SQL query, fetches several thousand rows, iterates the resultset, and closes the connection. On each iteration I also need to update each source row in the remote database using PreparedStatement.
In other words, in every OnProcessInput call I have a long running SELECT statement and several thousands small UPDATE statements.
The problems I'm facing are:

.png)
(2).jpg)
.png)