connection-pooling

hibernate c3p0 broken pipe

蹲街弑〆低调 提交于 2019-12-06 12:16:25
问题 I'm using hibernate 3 with c3p0 for a program which constantly extracts data from some source and writes it to a database. Now the problem is, that the database might become unavailable for some reasons (in the simplest case: i simply shut it down). If anything is about to be written to the database there should not be any exception - the query should wait for all eternity until the database becomes available again. If I'm not mistaken this is one of the things the connection pool could do

MySQL ODBC 3.51 - How to disable connection pooling from the ODBC GUI?

自作多情 提交于 2019-12-06 07:31:13
How do I disable connection pooling for MySQl ODBC Driver 3.51 on Windows7/Server2008 via the ODBC GUI? I do my own connection pooling at the app level, making connections as and when needed, and storing them for a fixed period until terminating them if not used. I use the ODBC's DSN string, so I need to be able to set the "Pooling=False" option from the ODBC configuration screen. Found it... The 32Bit ODBC GUI is started from C:\Windows\SysWow64\odbcad32.exe. In this GUI, there is a tab on the first screen called "Connection Pooling". Click on this, you get a list of drivers. There is a

Java servlets and database connection pooling

梦想的初衷 提交于 2019-12-06 07:18:08
问题 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 seems more efficient than a per servlet pool.. Also, since I'm thinking about implementing such a pool. Is there a way to have a class initialized before the servlets(I'm using jetty btw)? I'm just

Why a connection pool of many opened connections is less costly for a system than to open a new connection every time?

社会主义新天地 提交于 2019-12-06 06:35:08
问题 An answer from here Typically, opening a database connection is an expensive operation, so pooling keeps the connections active so that, when a connection is later requested, one of the active ones is used in preference to opening another one. I understand the concept of Connection Pool in DB management. That is the answer for a " what is ~ " question. All developers blog posts, answers, tutorials, DB docs out there always answer for a question " what is ". Like they constantly copy/paste

Do I need to use C3P0 pooling library in my (grails) web application?

霸气de小男生 提交于 2019-12-06 06:06:14
I am not familiar at all with connection pooling library. I've just discovered it through this blog article ) and I am not sure that I should use one in my web application based on grails/hibernate/mysql. So my question is simple : in which situations would you suggest to integrate a connection pooling library into a grails application? Always, Never or only over some connections threshold? P.S. : If you have ever used successfully C3P0 in your web application, I will greatly appreciate to hear your feedback (in terms of visible positive effects). Regardless of which pooling implementation,

How can I detect condition that causes exception before it happens?

蹲街弑〆低调 提交于 2019-12-06 05:41:20
问题 I had no luck with this question so I've produced this simple-as-possible-test-case to demonstrate the problem. In the code below, is it possible to detect that the connection is unusable before trying to use it? SqlConnection c = new SqlConnection(myConnString); c.Open(); // creates pool setAppRole(c); // OK c.Close(); // returns connection to pool c = new SqlConnection(myConnString); // gets connection from pool c.Open(); // ok... but wait for it... // ??? How to detect KABOOM before it

Jetty mysql connection-pool configuration error: javax.naming.NameNotFoundException; remaining name 'env/jdbc/---(mysql 5.0+jetty 7.0.1)

帅比萌擦擦* 提交于 2019-12-06 03:29:38
问题 My configuration files project/WEB-INF/web.xml : <resource-ref> <description>ConnectionPool DataSource Reference</description> <res-ref-name>jdbc/mysql</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> project/WEB-INF/jetty-env.xml: <New id="mysql" class="org.eclipse.jetty.plus.jndi.Resource"> <Arg></Arg> <Arg>jdbc/mysql</Arg> <Arg> <New class="org.apache.commons.dbcp.BasicDataSource"> <Set name="driverClassName">com.mysql.jdbc.Driver</Set

How to setup an empty password for a MySQL connection pool in glassfish 4 from the GUI?

巧了我就是萌 提交于 2019-12-06 03:17:34
问题 Im being unable to set an empty password for a MySQL connection pool from the GUI in glassfish 4. In previous versions of glassfish it used to work by simply putting "()" without the quotes. It doesnt work anymore for me in glassfish 4. By the way, I've been googling my issue with any luck. Does anyone know what is the proper way to do it in glassfish 4? Thanks in advance for you support Regards 回答1: What I did to fix this was to manually in /glassfish/domains/(yourDomainName)/domain.xml add

How to keep the connection pool from closing with a java driver on a mongodb?

自古美人都是妖i 提交于 2019-12-06 03:17:33
问题 I'm in the middle of upgrading from java driver 2.12.3 to 3.3.0. Curiously it seems that the collection pool is suddenly "acting up". My set up is as follows: The Connection is established in the main thread: mongoClient = new MongoClient(new MongoClientURI("mongodb://localhost:27017")); mongoClient.setWriteConcern(new WriteConcern(0, 10)); // deprecated, replace soon database = mongoClient.getDatabase("Example"); // java.util.logging.Logger.getLogger("org.mongodb.driver").setLevel(Level

HikariCP and maxLifetime

北城余情 提交于 2019-12-06 02:51:08
问题 I moved my project to HikariCP. Everything is going fine so far, but with one setting I'm having trouble. It's the .setMaxLifetime(30*1000) setting in HikariConfig object. I get this warning WARN com.zaxxer.hikari.HikariConfig - maxLifetime is less than 120000ms, using default 1800000ms. I know that they recommend not setting is that low as I am trying to. But Unfortunately due to circumstances that I can not change, every TCP connection that is open longer than 50 secods will be terminated