• Post Reply Bookmark Topic Watch Topic
  • New Topic

useBean + code generation

 
Naresh Chaurasia
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sebastien Col
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Sebastien
 
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
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!