Usage of ArrayList and Vector
As we know Arraylist is non-synchronised and vector is synchronised.So we normally use Arraylist for multi-user accessing many times.For the same purpose i may not use Vector.For example, i have a session bean in EJB, From this i am calling an entity bean with some results, where in i am sending those reults through one Vector. My question is, is it mean that the retuned results are not accessible my more than a user?In that situations i have to use a ArrayList for multi-user accessing.
How for it is correct.If the Vector is not suitable for that situation, in which scenarios i can use Vector.
Please clarify this.
thanks in advance,
synchronization is used for maintaining DATA-INTEGRITY in multi-user environment.
When you dont have multiple users UPDATING / MODIFYING the same collection. you can very well go for a non-synchronized implementation. because here, multiple users ONLY read from the collection
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL