[Hibernate-JIRA] Created: (HSEARCH-374) Timeout support for lucene searches
by Benjamin Gniza (JIRA)
Timeout support for lucene searches
-----------------------------------
Key: HSEARCH-374
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-374
Project: Hibernate Search
Issue Type: New Feature
Components: query
Reporter: Benjamin Gniza
Attachments: bit-TimeoutPatched-Hibernate-Search-1.0.1EXPERIMENTAL.zip
It would be nice to add support for the TimeLimitedCollector of Lucene (Versions 2.4.0 and above).
We needed that feature in our project within a week so we couldn't wait for a new official release and had to imlement it on our own.
Check out https://sourceforge.net/projects/timeoutpatchhib/ for our source (LGPL just as requested by hibernate).
I attached our current source code to the Jira issue. New versions will be published on sourceforge, please refer to https://sourceforge.net/projects/timeoutpatchhib/ for the most current one. The attached source only includes the code to support the TimeLimitedCollector.
We also have an experimental version which tries to find the reason of a BooleanQuery.TooManyClausesException within the offending user search term. For more information take a look at the sourceforge project.
Note: We didn't overide the query.setTimeout(int) method because we didn't know if this would have caused other side effects. So we created a method query.setTimeout(long).
Changed Methods:
- org.hibernate.search.FullTextQuery
-- +isSearchTimoutExceeded()
-- +setTimeout(long)
-- +getTimeout()
- org.hibernate.search.query.FullTextQueryImpl
-- getQueryHits(IndexSearcher, Integer)
-- +isSearchTimoutExceeded()
-- +setTimeout(long)
-- +getTimeout()
- org.hibernate.search.query.QueryHits
-- Constructors
-- scoreDoc(int)
-- updateTopDocs(int)
-- +getTopDocCollector(int)
-- +getHitCollectorForSearch(TopDocCollector)
-- +isTimeLimitExceeded()
--
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
14 years, 2 months
[Hibernate-JIRA] Created: (ANN-668) Method in entity with return type of ArrayList<Object[]> causes failure to build session factory
by Clint Popetz (JIRA)
Method in entity with return type of ArrayList<Object[]> causes failure to build session factory
------------------------------------------------------------------------------------------------
Key: ANN-668
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-668
Project: Hibernate Annotations
Issue Type: Bug
Affects Versions: 3.3.0.ga
Environment: Hibernate 3.2.X, no database needed (happens during factory build before connecting to db)
Reporter: Clint Popetz
Attachments: propertyTypeExtractorBug.tar.gz
The following source:
@javax.persistence.Entity
public class TestEntity {
@javax.persistence.Id
public int Id;
public java.util.ArrayList<Object[]> badMethod() { return null; }
public static void main(String args[]) {
new org.hibernate.cfg.AnnotationConfiguration().addAnnotatedClass(TestEntity
.class).configure().buildSessionFactory();
}
}
will cause:
java.lang.IllegalArgumentException: No PropertyTypeExtractor available for type void
at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.toXType(JavaReflectionManager.java:164)^M
at org.hibernate.annotations.common.reflection.java.JavaXMethod.create(JavaXMethod.java:18)
at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.getXMethod(JavaReflectionManager.java:128)
at org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredMethods(JavaXClass.java:114)
at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:214)
at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:133)
at org.hibernate.validator.event.ValidateEventListener.initialize(ValidateEventListener.java:91)
at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:356)
at org.hibernate.cfg.Configuration.getInitializedEventListeners(Configuration.java:1304)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
Changing the return type to List<Object[]> avoids the bug.
Attached is a tgz of an ant-buildable project; typing "ant run" will illustrate the bug.
--
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
14 years, 2 months
[Hibernate-JIRA] Created: (HHH-3873) DB2Dialect.getLimitString raise DB2 error message when called with limit=0
by Julien Kronegg (JIRA)
DB2Dialect.getLimitString raise DB2 error message when called with limit=0
--------------------------------------------------------------------------
Key: HHH-3873
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3873
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.1
Environment: DB2,
http://viewvc.jboss.org/cgi-bin/viewvc.cgi/hibernate/core/branches/Branch...
http://viewvc.jboss.org/cgi-bin/viewvc.cgi/hibernate/core/branches/Branch...
Reporter: Julien Kronegg
Priority: Minor
Executing a query called with setMaxResults(n) makes the underlying Hibernate code to call DB2Dialect.getLimitString.
While this is working fine in general case, the following database error is raised when setting the maximum number of results to zero:
SqlException: NUMBER 0 DIRECTLY SPECIFIED IN AN SQL STATEMENT IS OUTSIDE THE RANGE OF ALLOWABLE VALUES IN THIS CONTEXT (1, 2147483647)
This is due to the getLimitString method in classes DB2400Dialect and DB2390Dialect :
public String getLimitString(String sql, int offset, int limit) {
return new StringBuffer(sql.length() + 40)
.append(sql)
.append(" fetch first ")
.append(limit)
.append(" rows only ")
.toString();
}
When the limit parameter is set to zero, the fetch limit is appended, which explains why the error message occur.
Solution:
------------
When the limit is 0, there should be no "fetch first" instruction appended (as 0 is the general convention for "no limit"). The code would be:
public String getLimitString(String sql, int offset, int limit) {
+ if (limit==0) return sql;
return new StringBuffer(sql.length() + 40)
.append(sql)
.append(" fetch first ")
.append(limit)
.append(" rows only ")
.toString();
}
Workaround:
------------------
In order to avoid the error message, getLimitString(n) or setMaxResults(n) should be called with the 'newN' argument:
int newN = (n==0?Integer.MAX_VALUE:n);
Note: since the workaround is quite easy, I set the priority to "Minor"
--
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
14 years, 2 months
[Hibernate-JIRA] Created: (HHH-4074) Polymorphic queries avoid with polymorphism="explicit" in hbm.xml file doesn't work
by Radics Laszlo (JIRA)
Polymorphic queries avoid with polymorphism="explicit" in hbm.xml file doesn't work
-----------------------------------------------------------------------------------
Key: HHH-4074
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4074
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.2
Environment: hibernate 3.3.2
Oracle 9i
Reporter: Radics Laszlo
hbm.xml:
<hibernate-mapping default-cascade="none">
<class name="hu.raiffeisen.aps.soa.entity.collateral.AncestorImpl" table="ANCESTOR" dynamic-insert="false" dynamic-update="false" polymorphism="explicit">
<id name="id" type="java.lang.Long" unsaved-value="null">
<column name="ID" sql-type="NUMBER(19)"/>
<generator class="sequence">
<param name="sequence">ANCESTOR_SEQ</param>
</generator>
</id>
<property name="top" type="java.lang.Long">
<column name="TOP" not-null="true" unique="false" sql-type="NUMBER(19)"/>
</property>
<union-subclass name="hu.raiffeisen.aps.soa.entity.collateral.DescendantImpl" table="DESCENDANT" dynamic-insert="false" dynamic-update="false" abstract="false">
<property name="bottom" type="java.lang.Long">
<column name="BOTTOM" not-null="true" unique="false" sql-type="NUMBER(19)"/>
</property>
</union-subclass>
</class>
</hibernate-mapping>
hql: "from AncestorImpl" fetch both ancestor and descendant rows
--
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
14 years, 2 months
[Hibernate-JIRA] Created: (HHH-4042) StatelessSession does not flush when using jdbc batch_size > 1
by Gael Beaudoin (JIRA)
StatelessSession does not flush when using jdbc batch_size > 1
--------------------------------------------------------------
Key: HHH-4042
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4042
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.1
Environment: JBoss 4.2.3, Linux, java 1.6, hibernate 3.3.1, entityManager 3.4.0, jboss seam 2.1.2, postgresql 8.3
Reporter: Gael Beaudoin
I'm using a StetelessSession to insert millions of rows : it works great and without using much memory. But I've just seen that with a jdbc batch size of 50 for example (<property name="hibernate.jdbc.batch_size" value="0"/> in my persistence.xml) the last round of inserts aren't flushed to the database. For example, with 70 insert, only the first 50 are sent to the database.
I've searched a lot about this issues and on this thread (https://forum.hibernate.org/viewtopic.php?f=1&t=987882&start=0), the only solution found is to set the batch_size to 1, which is really a shame.
I've tried to flush the session, close the jdbc connection, etc etc ... no luck.
I'd be fine with a way to set the batch_size to 1 only for this method, pro grammatically, but I've not found any way to do that.
If you don't pay attention, it's a easy way to lose data.
--
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
14 years, 2 months