[Hibernate-JIRA] Created: (HHH-2343) SchemaUpdate and c3p0 connection pool too many connections
by Vlad Skarzhevskyy (JIRA)
SchemaUpdate and c3p0 connection pool too many connections
----------------------------------------------------------
Key: HHH-2343
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2343
Project: Hibernate3
Type: Bug
Components: build
Versions: 3.2.1
Environment: hibernate 3.2.1.ga, hibernate-annotations, oracle ojdbc14_g 10.2.0.2, c3p0 0.9.0 or 0.9.0.4, Sun Java 1.5.0.10, Win XP.
Reporter: Vlad Skarzhevskyy
- I have application, configured to use c3p0 as connection pool
<property name="c3p0.max_size">2</property>
- When SchemaUpdate is enabled
<property name="hibernate.hbm2ddl.auto">update</property>
Application (hibernate) creates ~100 connections to database and c3p0 pool initialized 42 times. (looks like number of entities in my domain)
There are no problems like this in hibernate 3.2.0.ga
I see this log statement 42 times in log
INFO Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@15a4a77
[ ... initialPoolSize -> 2, ... maxPoolSize -> 2, ]
INFO 2007-01-04 13:39:55,796 2031- [..] [C3P0Registry.banner:77] com.mchange.v2.c3p0.C3P0Registry.banner(C3P0Registry.java:77) [main]
Initializing c3p0-0.9.0.4 [built 23-January-2006 22:20:29 -0500; debug? true; trace: 10]
INFO 2007-01-04 13:39:56,093 2328- [..] [PoolBackedDataSource.getPoolManager:257] com.mchange.v2.c3p0.PoolBackedDataSource.getPoolManager(PoolBackedDataSource.java:257) [main]
Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@bc312f [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@5f1ba8 [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 5f1ba8, idleConnectionTestPeriod -> 3000, initialPoolSize -> 2, maxIdleTime -> 5000, maxPoolSize -> 2, maxStatements -> 100, maxStatementsPerConnection -> 0, minPoolSize -> 2, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@13c4c09 [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 13c4c09, jdbcUrl -> jdbc:oracle:thin:@torvspocapp:1522:ENT10, properties -> {user=******, password=******} ], preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ], factoryClassLocation -> null, identityToken -> bc312f, numHelperThreads -> 3 ]
......
And so on 42 times.
hibernate.cfg.xml
----
<property name="hibernate.connection.pool_size">0</property>
<property name="c3p0.acquire_increment">1</property>
<property name="c3p0.min_size">2</property>
<property name="c3p0.max_size">2</property>
<property name="c3p0.timeout">5000</property>
<property name="c3p0.idle_test_period">3000</property>
<property name="c3p0.max_statements">100</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<property name="hibernate.bytecode.use_reflection_optimizer">false</property>
----
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
17 years, 2 months
[Hibernate-JIRA] Created: (HHH-2306) put() fails on lazy one-to-many Map
by Andreas Idl (JIRA)
put() fails on lazy one-to-many Map
-----------------------------------
Key: HHH-2306
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2306
Project: Hibernate3
Type: Bug
Versions: 3.2.0.ga, 3.2.1
Environment: HIbernate 3.2.1. with Mysql 4
Reporter: Andreas Idl
Priority: Critical
Attachments: MapTest.zip
If I add n objects to a lazy-loaded one-to-many map, the first added object is not contained afterwards.
The size of the map is (n-1).
Document document = (Document) session.load(Document.class,documentId);
DocumentHistory history = new DocumentHistory();
history.setVersion(1);
history.setTitle(document.getTitle());
history.setContent(document.getContent());
history.setDocument(document);
// Put the new history into the map.
Map<Integer, DocumentHistory> histories = document.getHistories();
histories.put(history.getVersion(), history);
//not equal because histories.size() is 0
assertEquals(1, histories.size());
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
17 years, 3 months
[Hibernate-JIRA] Created: (HHH-2535) Change Cache' Cache71Dialect so that sequence support returns false
by Jay Howell (JIRA)
Change Cache' Cache71Dialect so that sequence support returns false
-------------------------------------------------------------------
Key: HHH-2535
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2535
Project: Hibernate3
Issue Type: Improvement
Components: core
Reporter: Jay Howell
We don't want the naive Cache' user to have to load our sequence support XML. This is okay for advanced users but we want Hibernate to work out of the box for the naive user.
This requires changing Cache71Dialect so that
public boolean supportsSequences() {
return false;
}
This problem was uncovered at a Java conference where there were many questions about getting Cache' to work with Hibernate. The developer at that conference discovered that the Hibernate tool SchemaUpdate required the developer to load our sequence support XML into a namespace to use SchemaUpdate at all. In other words, SchemaUpdate insists on sequence support if
public boolean supportsSequences() {
return true;
}
Since we don't want naive Cache' users to run into this problem, it should be changed to
public boolean supportsSequences() {
return false;
}
The sophisticated Hibernate and Cache' user can do the following:
public class CacheSeqDialect extends Cache71Dialect {
public boolean supportsSequences() {
return true;
}
}
They can follow our instructions for enabling sequence support and then use a CacheSeqDialect as above that they define to enable sequence support.
It is better that the advanced user be a little bit inconvenienced then the naive user have trouble working with Hibernate and Cache'. This is the reason we would like the above change made to the Cache71Dialect.
Jonathan Levinson (developer of Cache71Dialect)
Senior Software Developer
Object Group
InterSystems
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 3 months