0
голосов
3ответов
2524 просмотров

we implement connection pooling ourselves, but why it always out of connection?

Following is the source code: //public class ConnectionPool implements Runnable public class ConnectionPool { private static Logger loger_error = Logger.getLogger("error"); // JDBC Driver name String driverName; // JDBC Connection URL String connectionURL; // Minimum si...

14
голосов
4ответов
8672 просмотров

How do you manage database connections in php?

So recently I've really started to use php actively, and I need some insights on different ways to use database connections. At first I just used the simple mysql_connect(): <?php $connection = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die(mysql_error()); mysql_select_db(DB_DB, $c...

3
голосов
5ответов
4894 просмотров

Java connection pool without JNDI?

I've a connection pool to access a MySQL DB from a servlet. I get the data source using a JNDI, which is defined on my META-INF/context.xml file. Everything is working fine, but I have to place the MySQL driver JAR within Tomcat's /common/lib folder, instead of webapp's WEB-INF/lib; otherwise th...

4
голосов
1ответов
4984 просмотров

Cancel/abort a connection from the ThreadSafeClientConnManager connection pool

I'm using ThreadSafeClientConnManager to manage a pool of client connections, because my application has several threads, which are simultaneously connecting to a webserver. Abstract sample code: HttpClient httpClient; ClientConnectionManager conMgr = new ThreadSafeClientConnManager(parameters...

2
голосов
1ответов
3889 просмотров

MySQL - Connection using Singleton pattern or a ConnectionPool?

The topic has already been on the table in some previous questions. New elements come with new problems. I am seeking here for the best way to handle database connection(s), concerning aspects of : maintainability, performance, security and implementation. I must mention that i am not interested ...

4
голосов
5ответов
4376 просмотров

Java servlets and database connection pooling

Just looking at examples of connection pooling on the web, they all implement connection pooling on a per servlet basis. So each servlet has its own pool of database connections. My question is, why is that preferable to something like a global pool of db connections? Since a global pool is s...

43
голосов
3ответов
31297 просмотров

What happens to an uncommitted transaction when the connection is closed?

Are they rolled back immediately? Are they rolled back after some period of time? Are they left in an uncommitted state? Is the behavior the same if connection pooling is used and the connections are simply reset?

2
голосов
1ответов
2551 просмотров

SqlConnection.ClearAllPools issue

I am using VSTS 2008 + .Net 3.5 + C# + ADO.Net + SQL Server 2008 Enterprise. I am learning http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.clearallpools.aspx about SqlConnection.ClearAllPools method. I want to know the behavior of this method is, if any connections fro...

0
голосов
3ответов
4806 просмотров

Connection pooling in SQL SERVER (express)- recommended amount?

is there a recommended amount of connections fro each application i have for use with connection pooling.., my apps are using asp.net and c# against sql express on the "same" server. I have 5 applications running, they are not used intensively, all connections are opened and closed.. So i was t...

1
голосов
1ответов
359 просмотров

Is there a way to use System.Transactions with connection pooling?

I think the System.Transaction classes in Framework 2.0 are a great tool, well designed, aimed to simplify code when working with transactions. But, (big but), it's impossible to use those classes with multiple connections to the same database (same connection string) without promoting to distri...

-2
голосов
2ответов
702 просмотров

Will php autoreconnect to MySQL?

$con = mysql_connect("localhost:".$LOCAL_DB_PORT, $LOCAL_DB_USER, $LOCAL_DB_PASS); mysql_select_db("hr", $con); mysql_query("set names utf8", $con); while(true) { do_stuff($con); sleep(50); } If connection timesout in 50 seconds,will $con still work?

7
голосов
3ответов
16862 просмотров

Setting and updating connection pool (OracleConnectionPoolDataSource) properties for best performance

In a Java web application I am working on, we are using OracleConnectionPoolDataSource for a database connection pool functionality. Each getConnection call includes the user's Oracle ID and password. So each user in a sense ends up with their own database connection pool. Currently we are using...

2
голосов
3ответов
4193 просмотров

Java Database Connection Pool for multiple databases (Shards)

I was wondering what the best technique for implementing a DB connection pool for a web application which uses shards. From what I can tell most (all?) open-source implementations only support a single database behind. At least, I have not found one that supports shards. Also, even though I usin...

30
голосов
4ответов
75378 просмотров

JDBC Connection pooling using C3P0

Following is my helper class to get DB connection: I've used the C3P0 connection pooling as described here. public class DBConnection { private static DataSource dataSource; private static final String DRIVER_NAME; private static final String URL; private static final String UN...

26
голосов
6ответов
8863 просмотров

Connection Pool Strategy: Good, Bad or Ugly?

I'm in charge of developing and maintaining a group of Web Applications that are centered around similar data. The architecture I decided on at the time was that each application would have their own database and web-root application. Each application maintains a connection pool to its own databa...

22
голосов
4ответов
21101 просмотров

How to access MySQL from multiple threads concurrently

We're doing a small benchmark of MySQL where we want to see how it performs for our data. Part of that test is to see how it works when multiple concurrent threads hammers the server with various queries. The MySQL documentation (5.0) isn't really clear about multi threaded clients. I should po...

0
голосов
1ответов
231 просмотров

ADO.NET + LINQ Connection = Can they reuse the same?

I have an ADO.NET connection object to an SQL Server (which will use connection pooling and all the nice things about it) in one Winforms application. We're adding some new stuff to this application and we thought that we could do it in LINQ to SQL, the question is, if we open a new connection l...

1
голосов
3ответов
1485 просмотров

How to alter connection in EclipseLink

I use EclipseLink in my application. EclipseLink uses some connection pool. I use EclipseLink internal one. Connection pool creates connection when it is needed and then keeps it for future use. I need to make one specific SQL call on each connection when it is created, but only once. What I nee...

1
голосов
2ответов
5491 просмотров

Validating Connection Before Handing over to WebApp in ConnectionPooling

I have connection pooling implemented in spring using Oracle Data Source. Currently we are facing an issue where connections are becoming invalid after a period of time. (May be Oracle is dropping those idle connections after a while). Here are my questions: Can Oracle database be configured to...

1
голосов
1ответов
397 просмотров

ADO.NET SqlData Client connections never go away

An asp.net application I am working on may have a couple hundred users trying to connect. We get an error that the maximum number of connections in the pool has been reached. I understand the concept of connection pools in ADO.NET although in testing I've found that a connection is left "sleeping...

0
голосов
3ответов
604 просмотров

Using Memcache for storing connection objects

Is it advisable to store SQL Connection objects in memcache?

6
голосов
2ответов
1973 просмотров

How do I decide the number of connections required in connection pooling?

I am using hibernate 3.2.2 in my application. For connection pooling, we are using c3p0 0.9.1. I am using Generic DAO Pattern and Open Session in View pattern to do database operation. We are working on new website of existing website. Right now, the no of visits is half million page visit in ...

5
голосов
5ответов
6430 просмотров

Auto reconnect to MySql after connection lost

I have a c# application that uses a MySql database, the problem that after a period of inactivity (8 hours) or when connection to the server where database is host is lost, the connection to the database is closed and database queries cannot be executed. how can i enable the auto reconnect to the...

2
голосов
2ответов
1717 просмотров

Managing concurrent access to an Apache Derby database

I have an Apache Derby database running (in networked mode) inside a java swing application, I connect to it through direct JDBC calls via a java client application. This is all very good and works great however I know have an additional requirement to implement concurrent licenses for this clie...

1
голосов
1ответов
1081 просмотров

What is the missing parameter in connection pooling?

<property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property> <property name="c3p0.max_size">100</property> <property name="c3p0.idleConnectionTestPeriod">300</property> <property name="c3p0.acqu...

3
голосов
1ответов
1350 просмотров

Repository Connection Pooling

I'm in a hoo-ha with my boss as I can't shift to using newer technologies until I have proof of some outstanding issues. One of the main concerns is how repositories deal with connections. One of the supposedly largest overheads is connecting and disconnecting to/from the database. If I have a...

6
голосов
3ответов
2053 просмотров

Hibernate not throwing exception when openSession is called and the connection to DB cannot be established

When I configure hibernate to connect to a DB and for some reason the connection fails, I noticed that it doesnt throw any exception neither when building the factory (which is acceptable) nor when I call sessionFactory.openSession() (which is less acceptable). What is more annoying is that sessi...

1
голосов
2ответов
518 просмотров

Shared/pooled connections to backend services in PHP

I'm trying to figure out the best way to minimize resource utilization when I have PHP talking to various backend services (e.g. Amazon S3 or any other random web services -- I'd like a general solution). Ideally, I'd like to have a single persistent connection to the backend (or maybe a small po...

1
голосов
2ответов
1892 просмотров

Tomcat JNDI Connection Pool docs - Random Connection Closed Exceptions

I found this in the Tomcat documentation here What I don't understand is why they close all the JDBC objects twice - once in the try{} block and once in the finally{} block. Why not just close them once in the finally{} clause? This is the relevant docs: Random Connection Closed Exceptions T...

7
голосов
1ответов
29523 просмотров

Hibernate c3p0 connection pool not timing out idle connections

We have a java server connecting to a MySQL 5 database usingHibernate as our persistence layer which is using c3p0 for DB connection pooling. I've tried following the c3p0 and hibernate documentation: Hibernate - HowTo Configure c3p0 connection pool C3P0 Hibernate properties C3P0.properties...