connection-pooling

Connection pooling in Spring Boot and mongo db

女生的网名这么多〃 提交于 2019-12-02 08:33:23
I am going through spring boot application and mongoDb connection POC. I have added following dependency: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-mongodb</artifactId> </dependency> Also I have gone through mongoB properties with properties: https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html Can you please how do we define connection pooling mechanism here? You cannot do this out of the box with application properties. You need to make use of MongoClientOptions to configure various aspects of

node.js mySQL connection via a singleton

北战南征 提交于 2019-12-02 05:06:56
问题 I'm using a singleton pattern for mySQL connections in node.js, there's one and only one connection for the whole application to use, my concern is if there's some timeout setting for this connection held by the singleton. This connection is supposed to live throughout the life cycle of the app. I searched and found some persistence examples using pool but not sure if this applies to this example, there's no pool of connections, there's only one connection to be shared between the components,

How do I make connection pooling work in DBX?

放肆的年华 提交于 2019-12-02 04:54:14
问题 Well, I managed get the delegate driver to set up properly, but connection pooling is still giving me a lot of trouble. From the descriptions given in the documentation, it appears that connection pooling should work like this: Set up the DBXPool driver delegate on a single, global Connection object Use this Connection object for all calls into the database Each DB call will get automagically routed through the delegate driver into a connection that's unique to its thread, owned by the

Keep getting org.hibernate.exception.JDBCConnectionException: could not execute query

 ̄綄美尐妖づ 提交于 2019-12-02 01:43:45
I've got a J2EE application which uses JSP pages as front end and Struts2 as controller. I also use Hibernate to map my objects into a MySql DB. when I deploy the application on the server It works fine but after an unpredictable period of time (like 1 or two days) wherever I've used hibernate queries I keep getting this error: org.hibernate.exception.JDBCConnectionException: could not execute query what makes it more interesting is the fact that when this situation happens, it's not like 100% of queries end up to this exception! sometimes some of them are executed properly. an example piece

How do I make connection pooling work in DBX?

爱⌒轻易说出口 提交于 2019-12-02 00:23:39
Well, I managed get the delegate driver to set up properly, but connection pooling is still giving me a lot of trouble. From the descriptions given in the documentation, it appears that connection pooling should work like this: Set up the DBXPool driver delegate on a single, global Connection object Use this Connection object for all calls into the database Each DB call will get automagically routed through the delegate driver into a connection that's unique to its thread, owned by the connection pool. In practice, I'm finding that everything seems to still be handled by the global Connection

What is best approach for connection pooling?

倾然丶 夕夏残阳落幕 提交于 2019-12-02 00:11:28
I am implementing connection pooling in project. Performance wise which is better approach to do it? Hibernate (using C3PO or DBCP) Configuring JDBC data-source in Application server. Application server Portability is not an important factor for me. Please suggest the approach. Connection pooling is implemented in the DataSource , and in both case Hibernate will use a datasource. The question is which data source implementation is used, and how is it configured: You can specify and configure the datasource right into the hibernate configuration You can configure the datasource in the app.

What is the relationship between open SqlConnections in the client app and processes in SQL Server?

╄→尐↘猪︶ㄣ 提交于 2019-12-01 22:14:32
I just tried to make a simple schema change to a table in a SQL Server database (by using the Design tool in SMSS). Whenever I tried to save the change, it kept timing out. I wondered whether this was due to existing connnections which were 'locking' the table. I decided to kill connections as an experiment. I queried master..sysprocesses to get the current spids for that database, and killed them one by one until I was able to save my schema change. (Not very scientific, but I'm far from an expert with SQL Server). Sure enough, when I had killed all the spids (bar the one which was me using

Opening a DbContext connection within an existing SqlConnection

﹥>﹥吖頭↗ 提交于 2019-12-01 21:23:40
问题 I'm interested if opening an Entity Framework's DbContext connection within an existing ADO.NET SqlConnection should be discouraged, provided that they both use the same connection string, i.e. operate on the exactly same database? For example: using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, new System.TimeSpan(0, 30, 0))) { using (SqlConnection connection = new SqlConnection(connectionString)) { connection.Open(); DoStuffWithEF(connectionString); ... } }

Preventing queries caching in MySQL

不羁岁月 提交于 2019-12-01 20:49:27
I'm using the tomcat connection pool via JNDI resources. In the context.xml : <Resource name="jdbc/mydb" auth="Container" type="javax.sql.DataSource" username="myusr" password="mypwd" driverClassName="com.mysql.jdbc.Driver" maxActive="1000" maxIdle="100" maxWait="10000" url="jdbc:mysql://localhost:3306/mydatabase" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" /> In web.xml : <resource-ref> <description>DB Connection</description> <res-ref-name>jdbc/mydb</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> The database is a MySQL one.

Closing a conneciton in the “unload” method

◇◆丶佛笑我妖孽 提交于 2019-12-01 17:45:18
I have inherited a web framework whereby the previous developer has opened and closed his database connections in the init/unload methods of the page life cycle. Essentially constructor is like this (simplified to demonstrate the point); public class BasePage { protected DBConnection _conn; public BasePage() { Init += StartConnection; Unload += EndConnection; } private void StartConnection(object sender, EventArgs e) { _conn = new DBConnection(Application["connectionstring"].ToString()); } private void EndConnection(object sender, EventArgs e) { if (_conn == null) return; if (_conn.Connection