1

I'm writing dynamic web project in Java and tried using Trove Collection in one of my servlets. I saw that the problem occurs in the collection create line and after that my project stacks. I've found that the Trove collections are not thread-safe (and maybe that's the problem in web project server side) but even when I tried this line:

 TIntObjectMap m = TCollections.synchronizedMap( new TIntObjectHashMap());

the project couldn't pass the line (by the way, in regular java project this line worked).

Can I use Trove collection in web project server side at all?

nalply
  • 26,770
  • 15
  • 78
  • 101
user2154591
  • 51
  • 1
  • 1
  • 2

1 Answers1

0

Yes you can, but as you noted, the collections are not thread safe. However, I don't see why the code you referenced would work standalone but not in a servlet. Can you post the code and the error you get ?

Nicholas
  • 15,916
  • 4
  • 42
  • 66