Library for caching references when fetching data from Database
This sounds like a simple question but I'm currently developing a server application that should be able to serve many clients at the same time.
Is there any pattern or -even better- a library that is capable of loading objects on demand from database and asynchronously post them to multiple remote calls.
I was thinking of hibernate. But since I'Ve just heard of it I'm not sure if that is what I need.
The problem that I have is that it would require tons of locks, queues and Runnables to build a threadsafe cache for objects build from database.
DO NOT REINVENT THE WHEEL!
JPA and Hibernate are both wonderful solutions for Object to Relational Database mapping.
Any JPA provider, and Hibernate, will effectively cache objects, even in multi-threaded environments.
If this is your first project working with ORM, take the time to learn it... you will never regret it.