Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Distributed Web application question

 
tiim fei
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One application was initially developed for a nondistributed env. The company recently purchased the Acme AppServer, which supports distributed HttpSession Objects. When deploying the app to the server, the deployer marks it as distributable in the dd to take advantage of this feature. Given this scenario, which two must be true ?
A. The J2EE web container must support migration of objects that implement Serializable.
B. The J2EE web container must use the native JVM Serialization mechanism for distributing HttpSession objects.
C. As per the spec, the j2ee web container ensures that distributed HttpSession objects will be stored in a database.
D. Storing references to EJB components in the HttpSession object might NOT be supported by J2EE web containers.

I remember that, those attribute of HttpSession object which implements Serializable interface would be guranteed to migrate correctly on different vm. But I don't know really all those choices provided here is correct or not.
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My answer is A.

The container which supports distributed HttpSession Objects must support migration of objects that implement Serializable.

Thanks
 
tiim fei
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I go through the spec 2.4
"Within an application marked as distributable, all requests that are part of a sessionmust be handled by one Java Virtual Machine1 (�JVM�) at a time. The container must be able to handle all objects placed into instances of the HttpSession class using the setAttribute or putValue methods appropriately. The following restrictions are imposed to meet these conditions:
� The container must accept objects that implement the Serializable interface.
� The container may choose to support storage of other designated objects in the HttpSession, such as references to Enterprise JavaBeans components and transactions.
� Migration of sessions will be handled by container-specific facilities."

I think D is correct. But for A, I think spec saying that only those objects which is set as attributes in HttpSession object should be guranteed to migrate correctly. So I don't think A is right. Also, I do think B and C are wrong.
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
The option D can be correct. But A is more specific.
The container can support the objects that are not Serializable, but it must accept the objects that are serializable.

� The container must accept objects that implement the Serializable interface.
� The container may choose to support storage of other designated objects in the HttpSession, such as references to Enterprise JavaBeans components and transactions.
� Migration of sessions will be handled by container-specific facilities."


Thanks
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Anyway we both are correct. The question ask for two options.

thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic