Reputation: 2092
I understand from a few other posts and my understanding on JAX-WS web services they are not thread-safe. My web service is going to get called by 100's of clients and we need to be able to process around 200 transaction/second.
My web service is going to interact with database to perform its work, if i introduce the synchronized keyword around the code that access the database I essentially will ensure only one thread access the database at a time, I wonder if I will still be able to achieve the required throughput in this case. thanks in advance for your help.
I have been told to actually move the database access work into another class and instaniate that class at the method level that way I won't need to use the synchronized keyword and still achieve thread safety. Is that correct?
Upvotes: 3
Views: 2072
Reputation: 3183
If you need transactions and thread safety why aren't you just using EJBs as your JAX-WS endpoints?
Upvotes: 2
Reputation: 4137
We need more info on the application.
In general - for performance in the case you describe + database access I recommend.
Start with these directions - I think you will see you can achieve your performance target like this.
Upvotes: 1