[Hibernate-JIRA] Created: (HSEARCH-1038) MassIndexer doesn't release Write Lock after completion
by Marc Schipperheyn (JIRA)
MassIndexer doesn't release Write Lock after completion
-------------------------------------------------------
Key: HSEARCH-1038
URL: https://hibernate.onjira.com/browse/HSEARCH-1038
Project: Hibernate Search
Issue Type: Bug
Components: massindexer
Affects Versions: 4.1.0.Alpha1
Reporter: Marc Schipperheyn
Massindexer doesn't seem to be releasing the write.lock after it completes.
My code for calling MassIndexer is
fts.createIndexer(clazz).purgeAllOnStart(true)
.optimizeOnFinish(true).threadsToLoadObjects(3)
.batchSizeToLoadObjects(30)
.threadsForSubsequentFetching(12).startAndWait();
My Hibernate configuration is
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="configLocation" value="classpath:hibernate.cfg.xml"/>
<property name="hibernateProperties">
<value>
hibernate.bytecode.provider=javaassist
hibernate.connection.driver_class=${jdbc.driverClassName}
hibernate.connection.is-connection-validation-required=true
hibernate.jdbc.batch_size=30
hibernate.dialect=${hibernate.dialect}
hibernate.use_sql_comments=false
hibernate.query.substitutions=true
hibernate.generate_statistics=true
hibernate.search.default.directory_provider=filesystem
hibernate.search.default.exclusive_index_user=false
hibernate.search.default.locking_strategy=native
hibernate.search.default.indexBase=${hibsearch.hibernate_index_dir}
hibernate.search.analyzer=nl.project.dao.hibernate.search.MyStandardAnalyzer
hibernate.search.autoregister_listeners=true
hibernate.connection.autoReconnect=true
hibernate.connection.autoReconnectForPools=true
hibernate.show_sql=${hibernate.show_sql}
hibernate.format_sql=${hibernate.format_sql}
hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory
hibernate.cache.provider_configuration_file_resource_path=/ehcache.xml
hibernate.cache.use_query_cache=true
hibernate.cache.use_second_level_cache=true
hibernate.cache.region_prefix=mercadosa
hibernate.cache.use_structured_entries=false
hibernate.hbm2ddl.auto=update
</value>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 1 month
[Hibernate-JIRA] Commented: (HHH-1570) criteria-api: filtering by key-many-to-one causes invalid sql
by Hasan Ceylan (JIRA)
[ https://hibernate.onjira.com/browse/HHH-1570?page=com.atlassian.jira.plug... ]
Hasan Ceylan commented on HHH-1570:
-----------------------------------
Hibernate doesn't seem to be caring what community provides.
I had provided the patch that works 4 years ago.
Thanks now there is github, you can fork and manage your own patches.
> criteria-api: filtering by key-many-to-one causes invalid sql
> -------------------------------------------------------------
>
> Key: HHH-1570
> URL: https://hibernate.onjira.com/browse/HHH-1570
> Project: Hibernate ORM
> Issue Type: Bug
> Components: query-criteria
> Affects Versions: 3.5.3, 3.6.0.Beta1
> Reporter: Joris Verschoor
> Assignee: Steve Ebersole
> Attachments: HHH-1570-fix.patch, HHH-1570-it.patch, hibernate.patch
>
>
> We have a class Price that has a composite-id using a couple of key-properties and some key-many-to-ones)
> One of those is "transportation", which has a many-to-one to transportationType
> When we query using: criteria.add(Expression.eq("price.transportation.transportationType.id", transId);, we get an invalid SQL statement: The table of transportation was not selected.
> I will try to make a testcase today or tomorrow, depending on my schedule.. Things will be more clear by then...
> We have created a work-around, by mapping the transportationID twice: once in key-property, and once as a many-to-one. (instead of one key-many-to-one)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 2 months
[Hibernate-JIRA] Created: (HHH-7022) AbstractMultiTenantConnectionProvider never closes connections causing resource exhaustion
by Tomas Salfischberger (JIRA)
AbstractMultiTenantConnectionProvider never closes connections causing resource exhaustion
------------------------------------------------------------------------------------------
Key: HHH-7022
URL: https://hibernate.onjira.com/browse/HHH-7022
Project: Hibernate ORM
Issue Type: Bug
Components: core
Affects Versions: 4.0.1
Environment: Hibernate 4.0.1.Final, any database, but tested locally with MySQL 5.1.58
Reporter: Tomas Salfischberger
Priority: Critical
In org.hibernate.service.jdbc.connections.spi.AbstractMultiTenantConnectionProvider the call to releaseConnection(String tenantIdentifier, Connection connection) does not actually close the connection. The method was probably copied from getConnection(String tenantIdentifier) resulting in this code:
{code}@Override
public void releaseConnection(String tenantIdentifier, Connection connection) throws SQLException {
selectConnectionProvider( tenantIdentifier ).getConnection();
}{code}
Which opens a new connection anytime a connection is supposed to be closed and thus quickly exhausts all available connections.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 2 months
[Hibernate-JIRA] Commented: (HHH-1570) criteria-api: filtering by key-many-to-one causes invalid sql
by Yoann Antoviaque (JIRA)
[ https://hibernate.onjira.com/browse/HHH-1570?page=com.atlassian.jira.plug... ]
Yoann Antoviaque commented on HHH-1570:
---------------------------------------
I looked at this issue, the experimental patch did not resolve the problem in our case, I had to modify it (will post it later today, once I have validated that it works completly for us).
I still have a "regression" in FumTest#testKeyManyToOne() but I think it is not a regression but another bug that was hidden due to the absence of loading of linked tables:
by adding those lines in FumTest#testKeyManyToOne(), i get a NonUniqueObjectException, failing exactly the same way, even with a non patched hibernate-core:
// new test case showing non refreshed composite keys
s = openSession();
InnerKey sid2 = new InnerKey();
sid2.setAkey("a");
sid2.setBkey("b");
Inner sup2 = (Inner) s.load(Inner.class, sid2);
assertEquals("dudu", sup2.getDudu());
MiddleKey mid2 = new MiddleKey();
mid2.setOne("one");
mid2.setTwo("two");
mid2.setSup(sup);
Middle m2 = (Middle) s.load(Middle.class, mid2);
assertEquals("bla", m2.getBla());
d = (Outer) s.load(Outer.class, did);
assertTrue( d.getId().getMaster().getId().getSup().getDudu().equals("dudu") );
s.delete(d);
s.delete( d.getId().getMaster() ); //we do not get the master from session but the one from did, therefore fail with NonUniqueObjectException !
s.save( d.getId().getMaster() );
s.save(d);
s.flush();
s.connection().commit();
s.close();
> criteria-api: filtering by key-many-to-one causes invalid sql
> -------------------------------------------------------------
>
> Key: HHH-1570
> URL: https://hibernate.onjira.com/browse/HHH-1570
> Project: Hibernate ORM
> Issue Type: Bug
> Components: query-criteria
> Affects Versions: 3.5.3, 3.6.0.Beta1
> Reporter: Joris Verschoor
> Assignee: Steve Ebersole
> Attachments: HHH-1570-fix.patch, HHH-1570-it.patch, hibernate.patch
>
>
> We have a class Price that has a composite-id using a couple of key-properties and some key-many-to-ones)
> One of those is "transportation", which has a many-to-one to transportationType
> When we query using: criteria.add(Expression.eq("price.transportation.transportationType.id", transId);, we get an invalid SQL statement: The table of transportation was not selected.
> I will try to make a testcase today or tomorrow, depending on my schedule.. Things will be more clear by then...
> We have created a work-around, by mapping the transportationID twice: once in key-property, and once as a many-to-one. (instead of one key-many-to-one)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 2 months
[Hibernate-JIRA] Created: (JPA-27) Problem whith criteria search
by Samuel Rettore (JIRA)
Problem whith criteria search
-----------------------------
Key: JPA-27
URL: http://opensource.atlassian.com/projects/hibernate/browse/JPA-27
Project: Java Persistence API
Issue Type: Bug
Affects Versions: 1.0.0
Reporter: Samuel Rettore
Two criteria to a search and no one uses criteria that works with JPQL criteria does not work seems to be the date field where the comparison does not work.
Criteria- fail
CriteriaBuilder builder = em.getCriteriaBuilder();
CriteriaQuery<SrhaplicacaoSaldo> criteriaQuery = builder.createQuery(SrhaplicacaoSaldo.class);
Root<SrhaplicacaoSaldo> root = criteriaQuery.from(SrhaplicacaoSaldo.class);
criteriaQuery.select(root);
criteriaQuery.where(builder.equal(root.get(SrhaplicacaoSaldo_.idaplicacao).
get(Srhaplicacao_.idaplicacao), idaplicacao),
builder.equal(root.get(SrhaplicacaoSaldo_.dataSaldo), dataSaldo));
criteriaQuery.orderBy(builder.desc(root.get(SrhaplicacaoSaldo_.dataSaldo)),
builder.desc(root.get(SrhaplicacaoSaldo_.idaplicacaosaldo)));
return em.createQuery(criteriaQuery).
setMaxResults(1).
getSingleResult();
JPQ - OK
return (SrhaplicacaoSaldo) em.createQuery("Select a from SrhaplicacaoSaldo a where "
+ "a.idaplicacao.idaplicacao=:idaplicacao and a.dataSaldo=:dtsaldo order by a.dataSaldo,a.idaplicacaosaldo ").
setParameter("idaplicacao", idaplicacao).
setParameter("dtsaldo", dataSaldo).
setMaxResults(1).
getSingleResult();
Tanks.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 2 months
[Hibernate-JIRA] Created: (HBX-1197) hbm2java annotations for 1:1 FK creates duplicate generator names
by Bob Fields (JIRA)
hbm2java annotations for 1:1 FK creates duplicate generator names
-----------------------------------------------------------------
Key: HBX-1197
URL: https://hibernate.onjira.com/browse/HBX-1197
Project: Hibernate Tools
Issue Type: Bug
Components: hbm2java
Affects Versions: 3.2LATER
Environment: hibernate-tools 3.5.0.Beta, hibernate 4.0.0.Final
Reporter: Bob Fields
Running hbm2java against schema with multiple 1:1 table relationships results in the annotation on every 1:1 referenced Entity getIdentifierId():
@GenericGenerator(name="generator", strategy="foreign", parameters=@Parameter(name="property", value="UncapitalizedEntityName"))
@Id @GeneratedValue(generator="generator")
Generator name must be unique for proper validation. I would suggest adding the EntityName to make this something globally unique like:
@GenericGenerator(name="EntityNameGenerator", strategy="foreign", parameters=@Parameter(name="property", value="UncapitalizedEntityName"))
@Id @GeneratedValue(generator="EntityNameGenerator")
Unfortunately, this code is not contained within a freemarker template file that can be overridden. PojpPropertyAccessors.ftl -> GetPropertyAnnotation.ftl -> Ejb3PropertyGetAnnotation.ftl -> ${pojo.generateAnnIdGenerator()}
This means the java code created by hbm2java must be manually modified every time is it generated.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 2 months