I've read that the connection pool of the C++ driver doesn't work with authenticated connections (article from end of 2013).
Is this (still) true?
Looking the documentation regarding the new C++ driver (named "legacy"), it seems that the relevant classes has been removed:
The ConnectionPool and ScopedDbConnection classes have been removed.
So the situation is even worse: not only the driver doesn't provide any mechanism for implement connections pools with authentication... it doesn't provide any pool connection mechanism at all :(
The rationale is detailed in this issue at MongoDB JIRA:
At this time, we have no plans to add pooling back into the legacy driver for the upcoming 1.0 release. It should be very straightforward to implement a simple pool for your application, and you will have one that does exactly what you want
Related
EF registers as scoped service, which means it creates many short connections to database.
One http request - one connection.
PostgreSQL doesn't handle a lot of concurrent connections very well. Like a maximum of 100.
Is PgBouncer needed for .NET Core applications with Entity Framework (Npgsql)?
PgBouncer manages the connection pool.
Or can Npgsql manage the connection pool correctly?
Or is this only relevant for Python and PHP?
Thanks!
Npgsql includes its own in-process connection pool (as is common with .NET database drivers), so using an external connection pool such as PgBouncer isn't mandatory (though it can still make sense in some scenarios for pooling connections across several client machines, etc.).
in Java, application servers like JBoss EAP have the option to periodically verify the connections in a database pool (https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/6.4/html/administration_and_configuration_guide/sect-database_connection_validation). This has been very useful for removing stale connections.
I'm now looking at a ADO.NET application, and I was wondering if there was any similar functionality that could be used with a Microsoft SQL Server?
I ended up find this post by redgate that describes some of the validation that goes on when connections are taken from the pool:
If the connection has died because a router has decided that it no
longer wants to forward your packets and no other routers like you
either then there is no way to know this unless you try to send some
data and don’t get a response.
If you create a connection and a connection pool is created and
connections are put into the pool and not used, the longer they are in
there, the bigger the chance of something bad happening to it.
When you go to use a connection there is nothing to warn you that a
router has stopped forwarding your packets until you go to use it; so
until you use it, you do not know that there is a problem.
This was an issue with connection pooling that was fixed in the first
.Net 4 reliability update (see issue 14 which vaguely describes this)
with a feature called “Connection Pool Resiliency”. The update meant
that when a connection is about to be taken from the pool, it is
checked for TCP validity and only returned if it is in a good state.
My application, running in a JBOSS standalone env, relies on a HornetQ (v2.2.5.Final) middleware to exchange messages between parts of my application in a local environment - not over the network.
The default TTL (time-to-live) value for the connection is 60000ms, I am thinking of changing that to -1 since, from an operative point of view, I am looking forward to keep sending messages through such connection from time to time (not known in advance). Also, that would prevent issues like jms queue connection failure.
The question is: what are the issues with never timing out a connection on the server side, in such context? Is that a good choice? If not, is there a strategy that is suited for such situation?
The latest versions of HornetQ automatically disable connection checking for in-vm connections so there shouldn't be any issues if you configure this manually.
All
I am making REST client calls from an EJB container (IBM Websphere v6.1) and cannot find any way to get a HTTP connection factory from WAS.
Is this possible in WAS 6.1?
Would expect be able to access this with JNDI so connection pool configuration, socket timeout, connection timeout, connections per URL etc could be centrally managed.
If not the alternative is to use a Client API such as HttpClient 4.3. But this has its own kettle of fish:
They recommend 'BasicHttpClientConnectionManager': "This connection manager implementation should be used inside an EJB container". However this implies one connection per thread which in an application with many threads will exhaust the resources of the O/S.
The other alternative 'PoolingHttpClientConnectionManager' seems to be a much better fit with much of the required controls, but in the the comments on the the Basic manager it says explicitly that the Pooling manager shouldn't be used in a EJB container managed context. Scanning the code for this it looks like the Pooling manager uses Future from the concurrent library but doesn't appear to directly use Threads.
Any suggestions about the best way forward would be appreciated - some options seem to be:
Test with PoolingHttpClientConnectionManager - with risk of subtle problems
Play safe with 'BasicHttpClientConnectionManager' but set short response and socket timeouts to constrain the number of concurrent sockets at the cost of lots of factory overhead. Yuk.
Some other way of getting access to the pool of HTTP connections in WAS 6.1.
Something else
Any suggestions for this rather ikky problem would be ideal.
Please don't suggest upgrading WAS - although future versions ie the WAS commerce version do seem to have a JCA HTTP Adaptor and 8.5 has a built in REST client.
Please don't publish responses relating to MQ/JMS, JDBC connection pooling or setting up resource adaptors for EIS other than HTTP.
I have J2EE Application where I am using JPA/Toplink now I want to implement external or internal connection pool ... please help me to figure out how to implement connection pooling with JPA/TopLink ...
Well you shouldn't implement a connection pool yourself.
If your app is running inside an app server (JBoss, Glassfish..) your JPA code will use the connection pools that are configured by the app server. If you are running standalone you can use any of the number of existing open source connection pool implementations such as DBCP.
I agree with Gregory, you don't want to write a connection pool yourself. Have a look at e.g. Proxool or Commons DBCP which are both well-tested opensource connection pools.
Proxool, in my opinion, has the advantage of being trivial to add to an existing project.