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.

Answers


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.


Need Your Help

Qt driver for PostgreSQL compilation error

qt postgresql compiler-errors

When compiling psql with following command:

iOS NSLog error with Unicode characters

objective-c ios unicode nsstring nslog

Can anyone tell me the cause of the discrepancy for the following results ?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.