Could anyone hint me how to configure SwarmCache for Hibernate to work in cluster (distributed cache)? Probably there are some other alternatives (please, don't suggest JBoss Cache)?
Actually, I don't know why the Hibernate documentation (see 19.2. The Second Level Cache) doesn't mention them as Cluster Safe but both OSCache and EHCache are usable in clustered environments. Probably because Hibernate doesn't officially supports them. Nevertheless, I know that both do work in distributed environment because I did it with EHCache and Matt Raible did it with OSCache (patching hibernate is recommended though). Check out Matt's blog post OSCache vs. EhCache for Hibernate's 2nd Level Cache, it's very informative.
Back to your question now... It's hard to give you a precise answer as you didn't give much details on your requirements and constraints but take into account that:
Now, without more details (replication vs invalidation? what cache concurrency strategy support do you need? what are your restrictions?), I can't say anything more.