Hello I have a design question.
Where is the best location on a servlet to access a database (assume a connection pool exists), and is database activity optimal when synchronized or left alone, for a high volume site?
When I say location on a servlet I mean, is it best to just write it in the service methods?
Or
Is it better to write it in its own method outside the service method?
Or
Is it better to write it in its own class which is instaniated and called within a service method or in singleton class which is shared among the site?
And is performance boosted if synchronization is used?
Where is the best location on a servlet to access a database (assume a connection pool exists), and is database activity optimal when synchronized or left alone, for a high volume site?
When I say location on a servlet I mean, is it best to just write it in the service methods?
Or
Is it better to write it in its own method outside the service method?
Or
Is it better to write it in its own class which is instaniated and called within a service method or in singleton class which is shared among the site?
And is performance boosted if synchronization is used?