connection-pooling

What are best practices on managing database connections in .NET?

≡放荡痞女 提交于 2019-12-18 13:09:34
问题 Regarding best practice for managing database connections in a .NET application -- I know that, in general, it's bad to pass around a connection object. However, I have some specific curiosities: 1. I have two instances of business objects, of different classes, in a parent-child relationship (the child is private.) Which of the following is best? Keep one private static connection open and shared, used by both objects, and left open until the parent is disposed. Keep two private static

SELECT 1 from DUAL: MySQL

六月ゝ 毕业季﹏ 提交于 2019-12-18 12:26:09
问题 In looking over my Query log, I see an odd pattern that I don't have an explanation for. After practically every query, I have "select 1 from DUAL". I have no idea where this is coming from, and I'm certainly not making the query explicitly. The log basically looks like this: 10 Query SELECT some normal query 10 Query select 1 from DUAL 10 Query SELECT some normal query 10 Query select 1 from DUAL 10 Query SELECT some normal query 10 Query select 1 from DUAL 10 Query SELECT some normal query

ODP.NET connection pooling: How to tell if a connection has been used

不问归期 提交于 2019-12-18 07:10:27
问题 I'm modifying a Winforms app to use connection pooling so data access can occur in background threads. The business logic is implemented in PL/SQL and there are a couple of security related stored procedures that have to be called in order to make use of the business logic. What I need is a way to tell if the connection has been used without a round-trip to the database. I don't think I can keep track of them in a HashSet because I doubt Equals or even ReferenceEquals could be relied upon.

Connection Pooling in .NET/SQL Server?

佐手、 提交于 2019-12-18 04:43:11
问题 Is it necessary or advantageous to write custom connection pooling code when developing applications in .NET with an SQL Server database? I know that ADO.NET gives you the option to enable/disable connection pooling -- does that mean that it's built into the framework and I don't need to worry about it? Why do people talk about writing their own connection pooling software and how is this different than what's built into ADO.NET? 回答1: The connection pooling built-in to ADO.Net is robust and

What is the maximum and minimum size of connection pool ADO.Net Supports in the connection string?

末鹿安然 提交于 2019-12-18 03:56:38
问题 What is the maximum and minimum size of connection pool ADO.Net Supports in the connection string. Min Pool Size=[max size ?] Max Pool Size=[min size] 回答1: There is no documented limit on Max Pool Size. There is however an exact documented limit on maximum number of concurrent connections to a single SQL Server (32767 per instance, see http://msdn.microsoft.com/en-us/library/ms143432(v=SQL.90).aspx). A single ADO.NET pool can only go to a single instance, so maximum effective limit is

Analyzing Connection Closed Exception in Spring/JPA/Mysql/Tomcat app

时间秒杀一切 提交于 2019-12-18 02:42:11
问题 PROBLEM I have recently been put in charge of a Java web application with code already written and in place. The app receives moderately high traffic and has peak hours of traffic between 11am to 3pm everyday. The application uses Spring, JPA(Hibernate), MYSQL DB. Spring has been configured to use tomcat jdbc connection pool to make connections to the DB. (Details of configuration at the end of the post) For the past few days, during the application's peak load hours, the application has been

eclipselink connection pooling

℡╲_俬逩灬. 提交于 2019-12-18 02:09:13
问题 If connection pooling is not defined in the persistence.xml for eclipse link, what is the default behavior? Will it open and close a JDBC connection for every transaction? Will it create a connection pool with some defaults? 回答1: The default connection pooling for EclipseLink when not using a data source is a pool of min/max 32 connections, with an initial of 1 connections. So each transaction will use a pooled connection, and not connect/disconnect. 回答2: If you use an application server

Changing datasource connection url runtime

左心房为你撑大大i 提交于 2019-12-17 22:57:30
问题 I am working on a project which uses spring + hibernate + mysql and c3p0 for connection pooling. Currently the properties for the connection pool are loaded via properties defined outside the src. (eg: ${db_uname}) Everything starts fine when we create the spring bean. It might so happen that the database to which we have connected is inaccessible for some reason, and we would like to switch hosts. Need to implement a call back, where it is supposed to connect to the new host and re

Hibernate: What is the connection pool and why is the default one unsuitable for production?

亡梦爱人 提交于 2019-12-17 22:06:27
问题 I'm very unfamiliar with Hibernate and have just started working on a web app that uses it with a MySQL database. I notice that the community documentation tutorial states: The built-in Hibernate connection pool is in no way intended for production use. It lacks several features found on any decent connection pool. Can someone elaborate on this? What exactly is it missing and what are problems people have with the 'default' one? On googling I found a website here but it doesn't really explain

.NET best practices for MongoDB connections?

五迷三道 提交于 2019-12-17 21:40:31
问题 I've been playing with MongoDB recently (It's AMAZINGLY FAST) using the C# driver on GitHub. Everything is working just fine in my little single threaded console app that I'm testing with. I'm able to add 1,000,000 documents (yes, million) in under 8 seconds running single threaded. I only get this performance if I use the connection outside the scope of a for loop. In other words, I'm keeping the connection open for each insert rather than connecting for each insert. Obviously that's