• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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?
 
Do not set lab on fire. Or this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic