Lets assume this scenario:
Lets say we have an application with 100 users, where each user is constantly browsing the application and each user fires 1000 queries within an hour.
Lets further assume the users have a normal 8 hours work program daily.
This would mean that database server will handle 100 x 1000 x 8 = 800 000 queries in a day. That is without activations happening.
With AM pooling and sticky connections you will have to use AM recycling, because you end up without memory. Lets say you will be limiting the number of AMs to 50,
so then each two users will share one AM instance on average.
But the trouble with activations is that is releasing any client specific state on passivation (EO/VO cache). So than the state will be re-queried again, next request after a passivation.
So in the worst case scenario, the server will have to endure 2 x 800 000 = 1 600 000 queries in a day, presuming that each user will click with a same frequency.
Of course this is an exaggeration for the sake of simplicity, the number might be somehow smaller, but anyhow larger than 800 0000 queries that the business requires.
In conclusion, by preferring AM recycling to DB recycling you will:
- consume more memory, because of the incorrect way of managing JDBC statements.
- activations/passivation will release memory, but it increases the number of queries against the database.
- you are saving memory by hitting in your most precious resource : database server. In practice most application use a Weblogic cluster, but a single Database server instance.
- it destroys the EO/VO cache every time passivation happens and that will increase the response time of the requests triggering activations.
- you will never really know how much memory you really need per user, because more time the user spends within the application, more screens the user opens, more memory consumes.
This doesn't happen when connections are being closed after each request, the memory increase when user is constantly opening new screens is much smaller.
In this
big world of web technologies where even the mighty J2EE looks small , ADF is the only framework I know not releasing database connections after each request.
If anyone can come up with an example, I would love to hear it.
ADF framework support the best practice, is only Fusion Dev guide that is kept outdated.
We did log few bugs with Oracle Support, but we are still waiting for a reaction from Dev Team:
Bug 20196697 : TUNING APPLICATION MODULE POOLS AND CONNECTION POOLS
Bug 20180377 : DOCUMENTATION ENHANCEMENT REQUEST: FUSION DEV GUIDE 11G AND 12C: AM TUNING
And I totally agree with your statement "sloppy programming by developers who don't understand the basics of the environment in which they are working".
Is exactly what we try to do here. Understand the basics.
Thanks,
Florin