[Hibernate-JIRA] Created: (HSEARCH-782) Unnecessary loading of @ContainedIn entities causes big performance hit
by Adam Harris (JIRA)
Unnecessary loading of @ContainedIn entities causes big performance hit
-----------------------------------------------------------------------
Key: HSEARCH-782
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-782
Project: Hibernate Search
Issue Type: Bug
Components: engine
Affects Versions: 3.4.0.Final
Environment: Hibernate 3.6.3
MS SQL Server 2005
Reporter: Adam Harris
Attachments: log4j.properties, optimizations.zip, org.hibernate.search.test.engine.optimizations.CollectionUpdateEventTest2-output.txt
This bug is somewhat related to HSEARCH-679 where I have added some comments.
Here is a simplified model:
{code:title=A.java|borderStyle=solid}
public class A {
@Field
private String name;
@ContainedIn
private Collection<B> b;
}
{code}
{code:title=B.java|borderStyle=solid}
@Indexed
public class B {
@Field
private String name;
@IndexEmbedded
private A a;
}
{code}
The basic problem is that every time a new instance of B is created and added to A's collection, all of the B instances in that collection have their index recreated. The reason this is a problem is that nothing in A has changed (e.g. the "name" field). There is no new information to add to all of the B indexes. As the number of objects in the collection grows, this becomes are real performance hit.
It seemed like HSEARCH-679 was trying to address this problem, but this may be a little different scenario.
I'm attaching some sample code and my log file that demonstrates the extra index events. Please see line 519 of the surefire log file.
--
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
13 years, 5 months
[Hibernate-JIRA] Created: (HSEARCH-773) Example in documentation contains compilation erros
by Juraj Martinka (JIRA)
Example in documentation contains compilation erros
---------------------------------------------------
Key: HSEARCH-773
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-773
Project: Hibernate Search
Issue Type: Improvement
Reporter: Juraj Martinka
"Example 1.9. Using JPA to create and execute a search" contains compilation errors (probably copy & paste error :) ):
http://docs.jboss.org/hibernate/stable/search/reference/en-US/html_single...
The correct version follows:
{code}
EntityManager em = entityManagerFactory.createEntityManager();
FullTextEntityManager fullTextEntityManager =
org.hibernate.search.jpa.Search.getFullTextEntityManager(em);
em.getTransaction().begin();
// create native Lucene query unsing the query DSL
// alternatively you can write the Lucene query using the Lucene query parser
// or the Lucene programmatic API. The Hibernate Search DSL is recommended though
QueryBuilder qb = em.getSearchFactory()
.buildQueryBuilder().forEntity( Book.class ).get();
org.apache.lucene.search.Query query = qb
.keyword()
.onFields("title", "subtitle", "authors.name", "publicationDate")
.matching("Java rocks!")
.createQuery();
// wrap Lucene query in a javax.persistence.Query
javax.persistence.Query persistenceQuery =
fullTextEntityManager.createFullTextQuery(query, Book.class);
// execute search
List result = persistenceQuery.getResultList();
em.getTransaction().commit();
em.close();
{code}
--
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
13 years, 5 months
[Hibernate-JIRA] Created: (HHH-6313) ClassCastException specifying type="character" in hbm.xml
by Martin (JIRA)
ClassCastException specifying type="character" in hbm.xml
---------------------------------------------------------
Key: HHH-6313
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6313
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.6.5, 3.6.4, 3.6.0
Environment: Hibernate 3.6.5, Oracle 10g
Reporter: Martin
I have a class containing a field of type java.lang.Character.
I map this to an Oracle char(1 byte) field using an hmb.xml file as follows:
<property name="IntroducedFlag" column="INTRODUCED" type="character" />
At runtime this results in the following exception:
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Character
at org.hibernate.type.descriptor.java.CharacterTypeDescriptor.unwrap(CharacterTypeDescriptor.java:34)
at org.hibernate.type.descriptor.sql.VarcharTypeDescriptor$1.doBind(VarcharTypeDescriptor.java:52)
at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:91)
at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:282)
at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:277)
at org.hibernate.loader.Loader.bindPositionalParameters(Loader.java:1873)
at org.hibernate.loader.Loader.bindParameterValues(Loader.java:1844)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1716)
at org.hibernate.loader.Loader.doQuery(Loader.java:801)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
at org.hibernate.loader.Loader.doList(Loader.java:2533)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
at org.hibernate.loader.Loader.list(Loader.java:2271)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:119)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1716)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
It works fine in Hibernate 3.5.6 but not in 3.6.0 onwards.
Also probably related to this issue:
https://forum.hibernate.org/viewtopic.php?f=1&t=1010175
--
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
13 years, 5 months
[Hibernate-JIRA] Created: (HHH-6562) Unknown collection role when accessing ElementCollection in Embeddable via Criteria API
by Paul Nardone (JIRA)
Unknown collection role when accessing ElementCollection in Embeddable via Criteria API
---------------------------------------------------------------------------------------
Key: HHH-6562
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6562
Project: Hibernate Core
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.6.6
Reporter: Paul Nardone
Attachments: test.zip
Appears to be an inconsistency between org.hibernate.ejb.criteria.path.PluralAttributePath#resolveRole and naming of CollectionPersisters
org.hibernate.MappingException: Unknown collection role: test.BookDefinition.bookMarks
at org.hibernate.impl.SessionFactoryImpl.getCollectionPersister(SessionFactoryImpl.java:701)
at org.hibernate.ejb.criteria.path.PluralAttributePath.resolvePersister(PluralAttributePath.java:58)
at org.hibernate.ejb.criteria.path.PluralAttributePath.<init>(PluralAttributePath.java:52)
at org.hibernate.ejb.criteria.path.AbstractPathImpl.get(AbstractPathImpl.java:162)
at test.Test.testTestSystem(Test.java:136)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:60)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:106)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:111)
at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
at $Proxy0.invoke(Unknown Source)
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
... Removed 26 stack frames
Click to hide stack frames
org.hibernate.MappingException: Unknown collection role: test.BookDefinition.bookMarks
at org.hibernate.impl.SessionFactoryImpl.getCollectionPersister(SessionFactoryImpl.java:701)
at org.hibernate.ejb.criteria.path.PluralAttributePath.resolvePersister(PluralAttributePath.java:58)
at org.hibernate.ejb.criteria.path.PluralAttributePath.<init>(PluralAttributePath.java:52)
at org.hibernate.ejb.criteria.path.AbstractPathImpl.get(AbstractPathImpl.java:162)
at test.Test.testTestSystem(Test.java:136)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:76)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:673)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:846)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1170)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.runWorkers(TestRunner.java:1147)
at org.testng.TestRunner.privateRun(TestRunner.java:749)
at org.testng.TestRunner.run(TestRunner.java:600)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:317)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:312)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:274)
at org.testng.SuiteRunner.run(SuiteRunner.java:223)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1039)
at org.testng.TestNG.runSuitesLocally(TestNG.java:964)
at org.testng.TestNG.run(TestNG.java:900)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:60)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:106)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:111)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
at $Proxy0.invoke(Unknown Source)
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 5 months