c3p0

c3p0 pool cannot establish a connection. How to debug this?

邮差的信 提交于 2019-12-11 02:49:15
问题 I have a Tomcat and PostgreSQL installed on a server. I'm having a connection problem trying to connect from my servlet to PostgreSQL database using c3p0 pool. I can reach DB if I'm running Tomcat locally on my laptop. Also I can connect from server to DB using psql (i.e. command line sql utility). But when I'm trying to deploy my servlet to server and establish a connection I'm getting the following error: java.sql.SQLException: Connections could not be acquired from the underlying database!

Configure c3p0 to close Hibernate session when connection is down

僤鯓⒐⒋嵵緔 提交于 2019-12-11 02:47:29
问题 I am using Hibernate with c3p0 for connection pooling. Since I am working in a multisharded database environment and the possibility of shards' downtime is a realistic use case scenario (by means external to the application at hand, e.g. someone just taking the shard down for whatever reason), I am trying to have c3p0 explicitly close the Hibernate session once it detects that the database connection is down so that I can skip the particular shard's session in my multi-shard scan. Is there a

c3p0 logging is not working

拜拜、爱过 提交于 2019-12-11 02:32:59
问题 I am not getting c3p0 logging, my log4j.properties file is as below: log4j.logger.org.hibernate=INFO, hb log4j.logger.org.hibernate.SQL=DEBUG log4j.logger.org.hibernate.type=TRACE log4j.logger.org.hibernate.hql.ast.AST=info log4j.logger.org.hibernate.tool.hbm2ddl=warn log4j.logger.org.hibernate.hql=debug log4j.logger.org.hibernate.cache=info log4j.logger.org.hibernate.jdbc=debug log4j.appender.hb=org.apache.log4j.ConsoleAppender log4j.appender.hb.layout=org.apache.log4j.PatternLayout log4j

sleeping/awaiting command processes due to misconfiguring tomcat+hibernate+database

£可爱£侵袭症+ 提交于 2019-12-11 02:27:37
问题 I am working on a legacy code and I was asked to find out why there are so many sleeping /awaiting command processes in sql server db . Most if not all of them have a program_name = 'jTDS' , take up a lot of CPU + physical_io and are 10+ days old. More I was looking into it more I was realizing that it must have something to do with database pooling. It appears as we have 2 places where we are using db pooling: • context.xml • applicationContext.xml On initial load of application, tomcat

Configure c3p0 in spring application context (intSQL and timezone)

核能气质少年 提交于 2019-12-11 02:05:00
问题 How to configure c3p0 in spring application context? I am running mybatis + spring + c3p0 + Oracle 11g. c3p0 documentation for extensions says: extensions Default: an empty java.util.Map A java.util.Map (raw type) containing the values of any user-defined configuration extensions defined for this DataSource. c3p0 documentation for user extensions to configurations says: <extensions> <property name="initSql">SET SCHEMA 'foo'</property> <property name="timezone">PDT</property> </extensions>

c3p0 ResultSet.unwrap throws an AbstractMethodError

筅森魡賤 提交于 2019-12-11 01:46:18
问题 I have a ResultSet object that I need to turn into an OracleResultSet so that I can call the getOPAQUE(String) method on it. I'm using c3p0 as my connection pool. The problem is that c3p0 wraps ResultSets in NewProxyResultSet objects. This shouldn't be a problem because I should just be able to call unwrap on the ResultSet like this: rs.unwrap(OracleResultSet.class) However, that doesn't work. It actually throws an AbstractMethodError: java.lang.AbstractMethodError: com.mchange.v2.c3p0.impl

How to configurate C3P0 to use datasource url for connection at the oracle database in jboss AS7

人盡茶涼 提交于 2019-12-11 00:44:45
问题 we are having trouble to configure c3p0 in jboss, there are 2 configurations files, and we don't know wich we have to change: Jboss datasource app-ds.xml: <datasources> <datasource jta="false" jndi-name="java:/TestJNDI" pool-name="TestPool" use-ccm="false"> <connection-url>jdbc:oracle:thin:@server_test:port:database</connection-url> <connection-property name="schema">schema</connection-property> <driver-class>oracle.jdbc.OracleDriver</driver-class> <driver>ojdbc6.jar</driver> <pool> <min-pool

c3p0.SQLWarnings Server user id 29 is not a valid user in database 'defaultdb'

人盡茶涼 提交于 2019-12-10 23:55:47
问题 I'm using Sybase ASE with Hibernate-core 4.2.8.Final, hiberante-c3po 4.2.8.Final, hibernate-search 4.4.2.Final My hibernate.cfg.xml file looks like so <property name="hibernate.connection.driver_class">com.sybase.jdbc4.jdbc.SybDataSource</property> <property name="hibernate.dialect">org.hibernate.dialect.SybaseDialect</property> <property name="hibernate.connection.url">jdbc:sybase:Tds:server:5000/dev</property> <property name="hibernate.connection.username">user</property> <property name=

Using c3p0 with Tomcat 8 DataSource

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 20:35:10
问题 I have a tomcat 8 server with a DataSource loaded. I want to know if it is possible to use this DataSource combined with c3p0 connection pool management. So far this is what I've tried. Context.xml <Context> ... <Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" maxIdle="30" maxTotal="100" maxWaitMillis="10000" name="jdbc/store" password="text" type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/db" username="user"/> </Context> hibernate.cfg.xml <hibernate

c3p0 seems to close active connections

混江龙づ霸主 提交于 2019-12-10 18:32:39
问题 I set unreturnedConnectionTimeout to release stale connections. I assumed that this was only going to close connections without any activity but it looks like this just closes every connection after the specified time. Is this a bug or is this 'as designed'? The manual states: unreturnedConnectionTimeout defines a limit (in seconds) to how long a Connection may remain checked out. If set to a nozero value, unreturned, checked-out Connections that exceed this limit will be summarily destroyed,