In the generated servlet code( P348), the request object is synchronized, while creating the instance of bean but in P351 the page scope is not synchronized. What is the difference between two. What is the need of synchronization in first case.
SCJP 1.4, SCWCD1.4, OCA(1Z0-007)
posted 11 years ago
Hello, I would say that the synchronization is useful for "shared" scopes like session scope. In this case (request scope) I don't think synchronization changes anything. But in the case of session scope, you would have to synchronize on the session object. As this code is generated, it always synchronizes on the scope.
Did Steve tell you that? Fuh - Steve. Just look at this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads