[Hibernate-JIRA] Created: (HHH-2548) when "order by" a composit object, which may be null, the result list returns only when the composit objcts not null
by Yu Deng (JIRA)
when "order by" a composit object, which may be null, the result list returns only when the composit objcts not null
--------------------------------------------------------------------------------------------------------------------
Key: HHH-2548
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2548
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.3
Environment: tomcat 5.5, eclipse3.2, jre1.5, postgreSQL8.1, hibernate3 and hibernate3.2
Reporter: Yu Deng
Priority: Critical
<hibernate-mapping package="com.grapevinecs.ams.domain.perbranch.inv">
<class name="InvItem">
<id name="id" column="id">
<generator class="hilo"/>
</id>
...
<many-to-one name="transferredDetails"/> <!-- FK: Points to corresponding entry for transferred inventory items -->
....
</class>
(another mapping file)
</hibernate-mapping>>
<hibernate-mapping package="com.grapevinecs.ams.domain.perbranch.inv">
<class name="InvTransferDetails" >
<id name="id" column="id">
<generator class="hilo"/>
</id>
<property name="returnedToICBC" type="com.grapevinecs.ams.dao.BooleanInteger" not-null="true"/>
...
</class>
</hibernate-mapping>
Probelm:
1) The result returns 3000 records ---- select count(*) from InvItem c where upper(c.invType) LIKE '%D%' and c.invSeries.closed = '0' and c.branch =60551 order by c.transferredDetails.returnedToICBC asc, c.stamp asc,c.invNmbr asc
2) result List return size 0 by this query --- from InvItem c where upper(c.invType) LIKE '%D%' and c.invSeries.closed = '0' and c.branch =60551 order by c.transferredDetails.returnedToICBC asc, c.stamp asc,c.invNmbr asc
1) is correct but 2) is not correct. only when transferredDetails in InvItem not null be returned. in case 2), I have no transferredDetails not null.
after I excuted the query 2), even I remove "c.transferredDetails.returnedToICBC asc", the result is still return nothing.
--
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
12 years, 9 months
[Hibernate-JIRA] Created: (HHH-6344) IN expression misses negation when using row-value queries
by Isak Jonsson (JIRA)
IN expression misses negation when using row-value queries
----------------------------------------------------------
Key: HHH-6344
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6344
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.6.5
Environment: Using the PostgreSQL Dialect
Tested on 3.6.5 and 3.6.0 with the same result. Works on 3.2, but there actual row value native queries are used
Reporter: Isak Jonsson
Attachments: MyEntity.java, MyRowValue.java
The queries in the attached JPA entities behave differently regarding whether or not it is a row-value query.
Test code using the attached entities:
{noformat}
List<Integer> values1 = new LinkedList<Integer>();
List<MyRowValue> values2 = new LinkedList<MyRowValue>();
values1.add(1);
values1.add(2);
values2.add(new MyRowValue(3,4));
values2.add(new MyRowValue(5,6));
em.createNamedQuery("MyEntity.query1").setParameter("values", values1).getResultList();
em.createNamedQuery("MyEntity.query2").setParameter("values", values1).getResultList();
em.createNamedQuery("MyEntity.query3").setParameter("values", values2).getResultList();
em.createNamedQuery("MyEntity.query4").setParameter("values", values2).getResultList();
{noformat}
Results in the following SQL:
{noformat}
select myentity0_.id as id85_, myentity0_.a as a85_, myentity0_.b as b85_ from MyEntity myentity0_ where myentity0_.a in (? , ?)
select myentity0_.id as id85_, myentity0_.a as a85_, myentity0_.b as b85_ from MyEntity myentity0_ where myentity0_.a not in (? , ?)
select myentity0_.id as id85_, myentity0_.a as a85_, myentity0_.b as b85_ from MyEntity myentity0_ where myentity0_.a=? and myentity0_.b=? or myentity0_.a=? and myentity0_.b=?
select myentity0_.id as id85_, myentity0_.a as a85_, myentity0_.b as b85_ from MyEntity myentity0_ where myentity0_.a=? and myentity0_.b=? or myentity0_.a=? and myentity0_.b=?
{noformat}
(No "NOT" in the last line)
persistence.xml properties:
{noformat}
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="false"/>
<property name="dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<property name="hibernate.use_sql_comments" value="true"/>
{noformat}
Thanks for any insight to this!
--
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
12 years, 9 months
[Hibernate-JIRA] Created: (HSEARCH-998) Unlock at startup using SimpleFSLockFactory
by David Polo (JIRA)
Unlock at startup using SimpleFSLockFactory
-------------------------------------------
Key: HSEARCH-998
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-998
Project: Hibernate Search
Issue Type: Bug
Components: massindexer
Affects Versions: 4.0.0.CR2
Environment: Java 1.6, Hibernate Search 4.0.0.CR2 on Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bits
Reporter: David Polo
I'm using SimpleFSLockFactory and I'm getting this exception after an unexpected shutdown of the application during indexation:
org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out
The workaround consists in executing this code at startup in order to unlock the indexes:
FullTextSession fullTextSession = Search.getFullTextSession(hbSession);
MutableSearchFactory searchFactory = (MutableSearchFactory) fullTextSession
.getSearchFactory();
IndexReader indexReader = fullTextSession.getSearchFactory()
.getIndexReaderAccessor().open("");
Map<Class<?>, EntityIndexBinder> indexBindingsForEntity = searchFactory
.getIndexBindingForEntity();
for (EntityIndexBinder eib : indexBindingsForEntity.values()) {
IndexManager[] indexManagers = eib.getIndexManagers();
DirectoryBasedIndexManager indexManager = (DirectoryBasedIndexManager) indexManagers[0];
Directory indexDirectory = indexManager.getDirectoryProvider()
.getDirectory();
if (IndexWriter.isLocked(indexDirectory)) {
IndexWriter.unlock(indexDirectory);
}
}
I have a single application that executes this code at startup so I think it's safe to unlock the Directory at this time.
I'm doing this because I'm using SimpleFSLockFactory and it leaves write.lock files.
I need to unlock at startup because I think using NativeFSLockFactory is not an option for me (I'm using NFS).
It will be a good thing if Hibernate Search have an "unlock at startup" option. It could be used only in cases like this (not all cases!).
In Solr there is an option:
<unlockOnStartup>true</unlockOnStartup>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 9 months
[Hibernate-JIRA] Created: (HHH-5927) Performance risk: Suboptimal synchronization in org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan
by Strong Liu (JIRA)
Performance risk: Suboptimal synchronization in org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan
---------------------------------------------------------------------------------------------------------
Key: HHH-5927
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5927
Project: Hibernate Core
Issue Type: Improvement
Components: core
Reporter: Strong Liu
Attachments: hotspot.png
with Order Demo (real-life simulation attempt test app) I have noticed that there is thread contention on createNamesQuery() which sounds suspicious.
After investigation it boils down to org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan. It serves as a cache (internal, not replacable) for queries using LRU algorithm (supplied from Apache utils).
Generally speaking, blocking threads in any sort of caches indicates a problem. From about 2000 calls, 700 got blocked (which is also not nice for context switching).
I guess, one of the problems is that there is exclusive synchronization in get method:
public synchronized Object get(Object key) {...}
which could be replaced by a more granular read-write lock.
org/hibernate/engine/query/QueryPlanCache.java
org/hibernate/util/SoftLimitMRUCache.java
--
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
12 years, 9 months
[Hibernate-JIRA] Created: (HHH-6483) Add addJar() and addClassesFromPackage() to EntityManagerFactoryBuilder
by Ondra Žižka (JIRA)
Add addJar() and addClassesFromPackage() to EntityManagerFactoryBuilder
-----------------------------------------------------------------------
Key: HHH-6483
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6483
Project: Hibernate Core
Issue Type: New Feature
Components: entity-manager
Affects Versions: 4.0.0.next
Reporter: Ondra Žižka
JPA's persistence.xml has <jar-file> :
{code}
<persistence>
<persistence-unit name="TestPU">
<jta-data-source>java:/TestDS</jta-data-source>
<jar-file>foo/bar/entities.jar</jar-file>
</persistence-unit>
</persistence>
{code}
It would be fine to have Ejb3Configuration.addClassesFromJar() with the same effect.
Also, Ejb3Configuration.addClassesFromPackage() would be handy, which would find package-info.class and scan it's place (dir, jar, ...) for entities
(assuming a package is in one place only).
After HHH-6159, they would be EntityManagerFactoryBuilder.addClassesFromJar() and EntityManagerFactoryBuilder.addClassesFromPackage(), respectively.
Without this feature, users tend to hack their own scanning or use external lib like Scannotation, which is pitty since scanning code is already in Hibernate.
Thanks for considering.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 9 months