Currently there exists an async branch of ServiceStack which will make it possible to create async services. But to get all benefits of async, all IO bound operations should be async and therefore all database requests should also be async. I am currently using OrmLite with Postgresql and I would therefore like to know if OrmLite supports async queries/operations? If not, what other .Net Micro-Orms supports async operations?
3 Answers
OrmLite has 1st class Async support for all its RDBMS Providers which support async ADO.NET provider implementations (inc. PostgreSQL/Npgsql), otherwise falls back "pseudo async" support over its sync ADO.NET provider APIs which allows using Async APIs in RDBMS providers that don't support it whilst able to benefit from async implementations when running against RDBMS providers that do.

- 141,670
- 29
- 246
- 390
-
too shame for not being async out of the box – DATEx2 Sep 07 '14 at 08:49
I've recently begun work on AsyncPoco, a fully asynchronous fork of the popular PetaPoco micro-ORM. It still needs some testing and some proper documentation/examples, and as of yet does not support PostgreSQL. UPDATE: AsyncPoco now has some basic documentation and samples, and PostgreSQL is now supported!
At any rate, you asked about other .NET micro-ORMs that support async operations, so I thought I thought I'd mention it as one to keep any eye on.

- 37,557
- 17
- 150
- 173
Sorry if I misunderstood the question
but why can you not wrap the calls using the Task Parallel Library TPL or equivalent?
This is what I do and I am quite happy with results. At the end of the day you are only querying for data...
Thanks

- 691
- 9
- 9
-
3You could, but that would entail putting each DB query as a blocking task on some background thread (by TPL defaults, that would be a ThreadPool thread). If the ThreadPool has at most 4 threads (one for each CPU core), then you can have at most 4 outstanding parallel DB queries. This might, in some cases, still be an advantage over doing everything sequentially on a single thread, but often you already have multiple concurrent threads going on anyway. With proper async, you could have many, many concurrently running DB queries outstanding. – skrebbel Apr 17 '13 at 20:34
-
1This will enable you to run those operations concurrently, the OP asked about running them asynchronously. Very different. Async on the server is all about consuming fewer threads, not more. – Todd Menier Dec 21 '13 at 18:42