Java, Spring, jt400 [AS400]
I have working WAR at server. At this moment, my endpoint opens connection to AS400, retrieve data and gives it as response. Yet, I would like to do some time optimization.
I did a Bean
declaration at @Configuration
that uses custom class where I use AS400ConnectionPool
and AS400
to create a connection in @PostConstruct
.
Getting a single response using custom endpoint works fine.
Nevertheless, in jt400
's documentation I did not find a way (or I missed something) that would allow to create a connection (e.g. with mentioned AS400ConnectionPool and AS400), maintain it (e.g. with setMaxLifetime), and then verify whether the connection has not expired before the endpoint obtains data (and if it has expired - refresh it first somehow).
I did try using ConnectionPoolEvent
, yet without proper results.
I want to do this time optimization, as endpoint is used only once/twice a day (appros x50 times in short period of time like 1-2min) and this connection handling seems to be a bottleneck.
Any tips, ideas, etc?