• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

distributable DD - what does it do ?

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Snippet from the spec:


The distributable element, by its presence in a web application deployment descriptor, indicates that this web application is programmed appropriately to be deployed into a distributed servlet container<!ELEMENT distributable EMPTY>


I believe the container should be responsible for supporting a distributable environment, and the app be programmed appropriately in order to be distributable.
1. How does the presence of this element in the web.xml force/guarantee the distributable nature of an app?
2. Assume that the app is programmed properly.
If this element is NOT specified in web.xml for the app, does it mean it cannot be deployed in a distributable environment ?
Really - what does the <distributable> tag do?
Rama
[ November 22, 2002: Message edited by: Rama Raghavan ]
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Rama Raghavan:
1. How does the presence of this element in the web.xml force/guarantee the distributable nature of an app?

In its most basic form, it is no more than a flag to tell the container that this application should work with any distribution features that it has.
There are some intelligent things a container can do, though. In a distributable application, every session-bound object must be Serializable, so a container can enable some validation to check this even when it is not running in distributed mode.

2. Assume that the app is programmed properly.
If this element is NOT specified in web.xml for the app, does it mean it cannot be deployed in a distributable environment ?

Not as a distributed application in any case. You see, there is no automated way to find out whether an application is really fit to run in a distributed container. The Serializable check I described above is easy to do, but it is by no means enough. There are numerous other things that can bite you in a distributed application -- assumptions about Singletons, data consistency issues, transient fields, etc.
Only you, the developer, can decide whether the application can be distributed. And the distributable flag is how you make that decision known to the servlet container.
Does this help?
- Peter
 
Rama Raghavan
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your quick response.
Agreed that application developer must ensure/program for distributability of the app. So reason enough that the container should not "care" if the app is in-fact "flagged" distributable or not.
I have developed/deployed apps in a distributed environment using Weblogic 6.X. The container does not STOP deployment to a cluster/multiple servers even though the web.xml does NOT have <distributable> tag, and the app works fine..session migrates on fail-over, to be specific.
If the app is distributed, and has non-serializable objects bound to session, Weblogic throws messages in the logs.
So - (absence of) tag in web.xml has had not impact to the behavior of the container or the app.
Rama
 
Peter den Haan
author
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Rama Raghavan:
I have developed/deployed apps in a distributed environment using Weblogic 6.X. The container does not STOP deployment to a cluster/multiple servers even though the web.xml does NOT have <distributable> tag

Yikes!

and the app works fine..session migrates on fail-over, to be specific.

Only because your session objects happened to be Serializable by sheer coincidence. In a non-distributable application, they do not have to be! I find this behaviour very dangerous. I'm willing to bet that over 90% of applications which were not specifically written to be distributable break in a distributed environment in subtle and not so subtle ways.
Heck, sometimes it seems that 90% of applications which were specifically written to be distributable break especially as load gets really high.
- Peter
 
Being a smart alec beats the alternative. This tiny ad knows what I'm talking about:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic