• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Pros & Cons of Vector/ArrayList in clusters

 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

In a clustered environment (WLS 8.x), since Vector, ArrayList, Hashtable & HashMap are all serializable, are there any advantages/disadvantages of using Vector over ArrayList and Hashtable over HashMap?

I read from the WLS doc that for replication to occur, objects in the session must be serializable, so all these 4 objects fit the bill (as long as the objects that they contain are serializable too).

If I'm merely using the objects contained in Vector & Hashtable for read-only, display purposes, would it be safe for me to switch to use ArrayList & HashMap to get rid of the synchronization overheads?

Thanks!
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Always use ArrayList and HashMap unless you are dealing with legacy code which requires the use of Vector and Hashtable.
 
Chengwei Lee
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes Roger. I know the advantages of ArrayList and HashMap over Vector and Hashtable in a single JVM environment. I'm just not sure whether it is the same in clusters?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic