简体   繁体   中英

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM