[Hibernate-JIRA] Created: (HHH-6635) C3P0: hibernate.c3p0.* configuration properties not properly parsed
by Guenther Demetz (JIRA)
C3P0: hibernate.c3p0.* configuration properties not properly parsed
-------------------------------------------------------------------
Key: HHH-6635
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6635
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 4.0.0.CR2, 4.0.0.CR1
Reporter: Guenther Demetz
Attachments: C3P0ConnectionProvider.java
testing Hibernate4.0.0 CR 2
I discovered that unfortunately there is still a problem using C3P0 as ConnectionProvider:
Though my patch provided with HHH-6327 made C3P0 work again,
hibernate-c3p0 specific parameters such as hibernate.c3p0.max_size are not passed correctly to C3P0 anymore.
The reason is that providing the patch for HHH-6327 I was not aware that the methods
com.mchange.v2.c3p0.DataSources.java
public static DataSource pooledDataSource( DataSource unpooledDataSource, Map overrideProps )
public static DataSource pooledDataSource( DataSource unpooledDataSource, Properties props )
are not processing the passed properties in the same way:
whilst the first method parses the keyvalues as they are,
the latter method peels the keyvalues by removing any "c3p0." prefix:
public static DataSource pooledDataSource( DataSource unpooledDataSource, Properties props ) throws SQLException
{
//return pooledDataSource( unpooledDataSource, new PoolConfig( props ) );
Properties peeledProps = new Properties();
for (Iterator ii = props.keySet().iterator(); ii.hasNext(); )
{
String propKey = (String) ii.next();
String propVal = props.getProperty( propKey );
String peeledKey = (propKey.startsWith("c3p0.") ? propKey.substring(5) : propKey );
peeledProps.put( peeledKey, propVal );
}
return pooledDataSource( unpooledDataSource, null, peeledProps );
}
The attached file does fix the problem.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[Hibernate-JIRA] Created: (HSEARCH-881) @Fields annotation calling getter multiple times
by adam (JIRA)
@Fields annotation calling getter multiple times
-------------------------------------------------
Key: HSEARCH-881
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-881
Project: Hibernate Search
Issue Type: Improvement
Components: engine
Affects Versions: 3.4.1.Final
Environment: hibernate 3.6.6; postgres
Reporter: adam
Priority: Minor
placing an @Fields annotation on a method appears to cause the method's getter to be called once for each @Field annotation inside the list. Depending on what's internal to the method, indexing speed may be optimized by setting the contents to a variable and thus only calling the method once.
/* class snippit */
@Fields({ @Field(name = "allPhrase", analyzer = @Analyzer(impl = TdarStandardAnalyzer.class)),
@Field(name = "all", analyzer = @Analyzer(impl = LowercaseWhiteSpaceStandardAnalyzer.class)) })
public String getKeywords() {
logger.info("get keyword contents: {}",getId());
/* debug on save */
INFO 2011-08-29 10:37:30,828 12676 (Resource.java:982) org.tdar.core.bean.resource.Resource - get keyword contents: 4798
INFO 2011-08-29 10:37:30,828 12676 (Resource.java:982) org.tdar.core.bean.resource.Resource - get keyword contents: 4798
...
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months