[Hibernate-JIRA] Created: (HHH-7286) SessionFactory getImplementors method causes performance issues with entity-name attribute
by Alain Menu (JIRA)
SessionFactory getImplementors method causes performance issues with entity-name attribute
------------------------------------------------------------------------------------------
Key: HHH-7286
URL: https://hibernate.onjira.com/browse/HHH-7286
Project: Hibernate ORM
Issue Type: Improvement
Components: core
Affects Versions: 3.6.5
Environment: Hibernate 3.6.5 Final, Orcale database 11g, JBoss 4.2.2
Reporter: Alain Menu
Hibernate provokes useless accesses to the class loader of JBoss due to the attribute entity-name which is present in each hbm mapping file. Hibernate tries to instantiate a class having this name before trying with the real name of the actual business object which cause a performance overhead and contention under heavy load conditions (benchmarking).
<hibernate-mapping package="com.example.hibernate.businessobject">
<class name="Employee" table="EMP" entity-name="Employee_EMP">
<!-- cache usage="read-only"/ -->
<id name="trigramme" type="string" column="CODUSR" />
<property name="firstname" column="PREUSR" type="string" />
<property name="name" column="NOMUSR" type="string" />
<property name="email" column="EMLUSR" type="string" />
</class>
</hibernate-mapping>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 11 months
[Hibernate-JIRA] Created: (HSEARCH-1112) Allow IndexedEmbedded/includePaths to support multiple root entities
by Marc Schipperheyn (JIRA)
Allow IndexedEmbedded/includePaths to support multiple root entities
--------------------------------------------------------------------
Key: HSEARCH-1112
URL: https://hibernate.onjira.com/browse/HSEARCH-1112
Project: Hibernate Search
Issue Type: Improvement
Reporter: Marc Schipperheyn
Currently includePaths can only be used in a root entity A.
If you use includePaths also in the embedded entity that is a root entity itself, any paths from A to C will fail, because using includePaths in the embedded entity B will set depth to 0.
In most cases, this is ok, however, it can be very limiting and this limitation shouldn't be there.
{code}
@Indexed
public class A{
@IndexedEmbedded(includePaths={"id","c.date"}
public B getB(){
return b;
}
}
@Indexed
public class B{
@IndexedEmbedded(includePaths={"label"}
public C getC(){
return c;
}
}
{code}
The above code will lead c.date to not be indexed because of includePaths="label".
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 11 months
[Hibernate-JIRA] Created: (HHH-6405) setFetchMode ignored in certain cases when using criteria queries
by David Mansfield (JIRA)
setFetchMode ignored in certain cases when using criteria queries
-----------------------------------------------------------------
Key: HHH-6405
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6405
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 4.0.0.Beta2, 3.6.5
Reporter: David Mansfield
Description:
Setting join type (e.g.) criteria.setJoinType("association.path", FetchType.JOIN) is ignored if the association being set is one of a few types. I believe many-to-many, and any association off of a collection-of-component. For these types of associations, the specified fetch type is ignored.
This worked in prior versions.
This has nothing to do with having additional restrictions on the same association, which is a different issue altogether.
Technical analysis:
This regression was introduced in git commit fbae6db0abaeb6f050ee97ce53d09d74886a7e47, and the fix for a possibly related issue in git commit 1c556dc775708706b6ca84251cb170d3c46f729f was not a complete fix, or rather did not fix this case scenario.
The first referenced commit split the JoinWalker.getJoinType(...) api into two methods, one with more parameters. In the base class implementation, one method or the other is called based on the type of association (see above). However, in the CriteriaJoinWalker (a subclass), the existing implementation only overrode one of these two methods, (the one with more arguments) causing calls into the other method to be handled by the base class, which did not function appropriately.
The second referenced commit introduced an override for the second method, however the implementation was incomplete, and was missing the crucial piece, specifically:
FetchMode fetchMode = translator.getRootCriteria().getFetchMode( path.getFullPath() );
which examined the explicitly set join types in the translator.
A fix will be supplied on github for 3.6.x and 4.0.
The implementation re-unifies the two methods in the CriteriaJoinWalker, using if/else to delegate to the correct super.getJoinType(...) method as appropriate.
--
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, 11 months
[Hibernate-JIRA] Created: (HSEARCH-1111) Setting targetElement param in @IndexedEmbedded on collection causes runtime exception
by Elmer van Chastelet (JIRA)
Setting targetElement param in @IndexedEmbedded on collection causes runtime exception
--------------------------------------------------------------------------------------
Key: HSEARCH-1111
URL: https://hibernate.onjira.com/browse/HSEARCH-1111
Project: Hibernate Search
Issue Type: Bug
Components: mapping
Affects Versions: 3.4.2
Environment: Hibernate 3.6.10, mysql 5.1
Reporter: Elmer van Chastelet
Attachments: embeddedTestWithAdditionalTargetClassField.diff
When I have an @IndexedEmbedded field with the targetElement set to a subclass of the embedded type (at least the case for a collection), indexing goes wrong.
After seeing this behavior in my own app, I extended src/test/java/org/hibernate/search/test/embedded/AbstractProduct to have a pricingFeatures field:
{code:java}
@ManyToMany(mappedBy="product", cascade=CascadeType.ALL) //just to make the test easier, cascade doesn't really make any business sense
@IndexedEmbedded(targetElement=PricingFeature.class)
private Set<ProductFeature> pricingFeatures = new HashSet<ProductFeature>();
{code}
Added PricingFeature class:
{code:java}
package org.hibernate.search.test.embedded;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Index;
public class PricingFeature extends ProductFeature {
@Field(index= Index.UN_TOKENIZED)
private String price;
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
}
{code}
The test itself {{org.hibernate.search.test.embedded.EmbeddedTest}} is untouched, and {{testEmbeddedToManyInSuperslass}} fails with the following exception:
{code}
EmbeddedTest
org.hibernate.search.test.embedded.EmbeddedTest
testEmbeddedToManyInSuperslass(org.hibernate.search.test.embedded.EmbeddedTest)
org.hibernate.HibernateException: Error while indexing in Hibernate Search (before transaction completion)
at org.hibernate.search.backend.impl.EventSourceTransactionContext$DelegateToSynchronizationOnBeforeTx.doBeforeTransactionCompletion(EventSourceTransactionContext.java:175)
at org.hibernate.engine.ActionQueue$BeforeTransactionCompletionProcessQueue.beforeTransactionCompletion(ActionQueue.java:554)
at org.hibernate.engine.ActionQueue.beforeTransactionCompletion(ActionQueue.java:216)
at org.hibernate.impl.SessionImpl.beforeTransactionCompletion(SessionImpl.java:571)
at org.hibernate.jdbc.JDBCContext.beforeTransactionCompletion(JDBCContext.java:250)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:138)
at org.hibernate.search.test.embedded.EmbeddedTest.testEmbeddedToManyInSuperslass(EmbeddedTest.java:368)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at junit.framework.TestCase.runTest(TestCase.java:168)
at org.hibernate.testing.junit.functional.annotations.HibernateTestCase.runTest(HibernateTestCase.java:97)
at org.hibernate.testing.junit.functional.annotations.HibernateTestCase.runBare(HibernateTestCase.java:85)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.IllegalStateException: Could not get property value
at org.hibernate.search.util.ReflectionHelper.getMemberValue(ReflectionHelper.java:94)
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.buildDocumentFields(DocumentBuilderIndexedEntity.java:477)
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.buildDocumentFields(DocumentBuilderIndexedEntity.java:526)
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.getDocument(DocumentBuilderIndexedEntity.java:443)
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.createAddWork(DocumentBuilderIndexedEntity.java:380)
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.addWorkToQueue(DocumentBuilderIndexedEntity.java:358)
at org.hibernate.search.engine.WorkPlan$PerEntityWork.enqueueLuceneWork(WorkPlan.java:456)
at org.hibernate.search.engine.WorkPlan$PerClassWork.enqueueLuceneWork(WorkPlan.java:257)
at org.hibernate.search.engine.WorkPlan.getPlannedLuceneWork(WorkPlan.java:150)
at org.hibernate.search.backend.WorkQueue.prepareWorkPlan(WorkQueue.java:134)
at org.hibernate.search.backend.impl.BatchedQueueingProcessor.prepareWorks(BatchedQueueingProcessor.java:124)
at org.hibernate.search.backend.impl.PostTransactionWorkQueueSynchronization.beforeCompletion(PostTransactionWorkQueueSynchronization.java:89)
at org.hibernate.search.backend.impl.EventSourceTransactionContext$DelegateToSynchronizationOnBeforeTx.doBeforeTransactionCompletion(EventSourceTransactionContext.java:172)
... 26 more
Caused by: java.lang.IllegalArgumentException: Invoking price with wrong parameters
at org.hibernate.annotations.common.reflection.java.JavaXProperty.invoke(JavaXProperty.java:84)
at org.hibernate.search.util.ReflectionHelper.getMemberValue(ReflectionHelper.java:91)
... 38 more
Caused by: java.lang.IllegalArgumentException: Can not set java.lang.String field org.hibernate.search.test.embedded.PricingFeature.price to org.hibernate.search.test.embedded.ProductFeature
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:164)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:168)
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:55)
at sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:36)
at java.lang.reflect.Field.get(Field.java:376)
at org.hibernate.annotations.common.reflection.java.JavaXProperty.invoke(JavaXProperty.java:77)
... 39 more
{code}
This is probably also applicable for HSearch 4.1.0, but untested.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 11 months
[Hibernate-JIRA] Created: (HHH-7283) hibernate is not compilable on JDK7
by Strong Liu (JIRA)
hibernate is not compilable on JDK7
-----------------------------------
Key: HHH-7283
URL: https://hibernate.onjira.com/browse/HHH-7283
Project: Hibernate ORM
Issue Type: Improvement
Components: testsuite
Reporter: Strong Liu
Assignee: Strong Liu
Executing task ':hibernate-core:compileTestJava' due to:
No history is available for task ':hibernate-core:compileTestJava'.
[ant:javac] Compiling 599 source files to /mnt/hudson_workspace/workspace/hibernate-core-master-jdk7/hibernate-core/target/classes/test
[ant:javac] /mnt/hudson_workspace/workspace/hibernate-core-master-jdk7/hibernate-core/src/test/java/org/hibernate/connection/DriverManagerRegistrationTest.java:151: error: TestDriver1 is not abstract and does not override abstract method getParentLogger() in Driver
[ant:javac] public static class TestDriver1 extends AbstractTestJdbcDriver {
[ant:javac] ^
[ant:javac] /mnt/hudson_workspace/workspace/hibernate-core-master-jdk7/hibernate-core/src/test/java/org/hibernate/connection/DriverManagerRegistrationTest.java:169: error: TestDriver2 is not abstract and does not override abstract method getParentLogger() in Driver
[ant:javac] public static class TestDriver2 extends AbstractTestJdbcDriver {
[ant:javac] ^
[ant:javac] Note: Some input files use or override a deprecated API.
[ant:javac] Note: Recompile with -Xlint:deprecation for details.
[ant:javac] Note: Some input files use unchecked or unsafe operations.
[ant:javac] Note: Recompile with -Xlint:unchecked for details.
[ant:javac] 2 errors
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 11 months