Re: [Cppcms-users] DB connection pooling
Brought to you by:
artyom-beilis
From: Lee E. <lee...@gm...> - 2012-10-22 13:00:44
|
I fail to see the connection between the application being asynchronious and the DB connections being pooled if you need to do several things with the same DB at the same time (or simply in different threads) you need several DB connections - you can choose to pool them - and this way reuse them both synchronious and asynchronious applications can handle multiple threads - so both need some way of using db connections - and a pool is one good way to do that On Mon, Oct 22, 2012 at 2:22 PM, Shiv Shankar Dayal < shi...@gm...> wrote: > Hi, > > Consider the following piece of documentation > > If the application that handles it is a synchronous application, its > execution is passed to the *thread pool*. The user application prepares > the response and sends it synchronously to the client and the context is > destroyed, completing the "requst/response" cycle. > > If the application is asynchronous, the HTTP Context remains inside the > event loop's thread and it is handled by the asynchronous application. This > application may decide to complete the response immediately or postpone it > by implementing, for example, long polling. > and following code > > 1. int main(int argc,char ** argv) > 2. { > 3. try { > 4. cppcms::service srv(argc,argv); > 5. srv.applications_pool().mount( > 6. cppcms::applications_factory<hello>() > 7. ); > > now as it is also written that applications are asynchronous what is the > need of more that one database connection. Is it the case that one > persistent connection will suffice? > -- > Best regards, > Shiv Shankar Dayal > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_sfd2d_oct > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > -- -- lee Lee Elenbaas lee...@gm... |