0

a single object in JVM can be run simultaneously by multiple threads. same bytecode will run in different threads.

keeping thread count same if we increase object or pooled object in the container do you think performance will increase? if yes then how?

if no then why EJB use the stateless polled objects to serve concurrent requests?

roconmachine
  • 1,876
  • 2
  • 17
  • 24
  • Strange question. This strongly suggests that you didn't knew that EJB methods are by default transacitonal (which means that they absolutely need to stay threadsafe). In that case this is perhaps the real Q&A you're looking for: https://stackoverflow.com/q/18369356 – BalusC Apr 25 '21 at 12:05

1 Answers1

1

Using the pool size you control how many threads can run the code of a bean in parallel. This can be important, e.g. if the maximum number of DBMS-Connections is limited.

On the other hand, if the poolsize would be greater than the available number of threads, then the pool will never get exhausted.

aschoerk
  • 3,333
  • 2
  • 15
  • 29