[Hibernate-JIRA] Created: (HHH-6738) Hardcoded alias causing problems
by Sven Uibo (JIRA)
Hardcoded alias causing problems
--------------------------------
Key: HHH-6738
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6738
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.6.6
Environment: Hibernate 3.6.6-Final, PostgreSQL 9.0
Reporter: Sven Uibo
org.hibernate.envers.entities.mapper.relation.query.TwoEntityQueryGenerator has hardcoded aliases. The "ee" alias is causing problems, because in Estonia most packages start with "ee.". A "_" suffix would be nice.
The exception thrown:
javax.ejb.EJBTransactionRolledbackException: could not resolve property: compname of: SchoolSyllabus_SchoolSyllabusDrivingTopicLog [select new list(ee, e) from SchoolSyllabus_SchoolSyllabusDrivingTopicLog ee, ee.compname.proj.business.entity.syllabus.SchoolSyllabusDrivingTopicLog e where ee.originalId.drivingTopics_id = e.originalId.id and ee.originalId.SchoolSyllabus_id = :SchoolSyllabus_id and e.originalId.ver_rev.id = (select max(e2.originalId.ver_rev.id) from ee.compname.proj.business.entity.syllabus.SchoolSyllabusDrivingTopicLog e2 where e2.originalId.ver_rev.id <= :revision and e.originalId.id = e2.originalId.id) and ee.originalId.ver_rev.id = (select max(ee2.originalId.ver_rev.id) from SchoolSyllabus_SchoolSyllabusDrivingTopicLog ee2 where ee2.originalId.ver_rev.id <= :revision and ee.originalId.SchoolSyllabus_id = ee2.originalId.SchoolSyllabus_id and ee.originalId.drivingTopics_id = ee2.originalId.drivingTopics_id) and ee.REVTYPE != :delrevisiontype and e.REVTYPE != :delrevisiontype]
--
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] Created: (HHH-7006) keyword "top" causes test fail on ms sql server
by Strong Liu (JIRA)
keyword "top" causes test fail on ms sql server
-----------------------------------------------
Key: HHH-7006
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-7006
Project: Hibernate ORM
Issue Type: Bug
Components: testsuite
Reporter: Strong Liu
Assignee: Strong Liu
Priority: Minor
Fix For: 4.1.0
org.hibernate.ejb.test.cascade.multilevel.MultiLevelCascadeTest.test
{quote}
Error Message
javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: Incorrect syntax near the keyword 'TOP'.
Stacktrace
javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: Incorrect syntax near the keyword 'TOP'.
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1361)
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1289)
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1295)
at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:976)
at org.hibernate.ejb.test.cascade.multilevel.MultiLevelCascadeTest.test(MultiLevelCascadeTest.java:47)
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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:63)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
{quote}
--
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] Created: (HHH-3910) Add support for custom dirty checking during flush
by Ovidio Mallo (JIRA)
Add support for custom dirty checking during flush
--------------------------------------------------
Key: HHH-3910
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3910
Project: Hibernate Core
Issue Type: Improvement
Components: core
Affects Versions: 3.3.1
Reporter: Ovidio Mallo
Currently, Hibernate supports a special dirty checking on instrumented entities
in order to improve the flush performance. IMO, this optimization can often be
rather significant. However, the drawback is that you have to use bytecode
instrumentation in order to take advantage of this performance improvement which
might not be an option in some projects.
Therefore, I wanted to propose to extend the current dirty checking during flush
in such a way that the dirtyness information can also be directly provided by
clients. Thereby, I could think of two possible approaches to do this:
1. Introduce an interface which client entities might implement in case they
have some notion of dirtyness. The interface could look something like:
public interface DirtyAwareEntity {
boolean getMightBeDirty();
void setMightBeDirty(boolean mightBeDirty);
}
Using such an interface, Hibernate could easily check whether an entity might
be dirty during flush and it could also reset the dirty flag after flush just
as is currently done for instrumented classes. So this approach would probably
be rather easy to implement and very convenient for clients since they would
only have to implement that interface on the appropriate entities and set the
dirty flag when the entity is actually modified.
2. Add some hooks on event listeners and/or on the Interceptor for querying whether
an entity is dirty and for resetting the dirty flag. E.g. one could add the
following hook method to the DefaultFlushEntityEventListener class:
protected boolean requiresDirtyCheck(FlushEntityEvent event);
By default, this method would call EntityEntry#requiresDirtyCheck(Object entity)
as is done right now.
Resetting the dirty flag could maybe be done in Interceptor#postFlush() or some
dedicated method could be provided.
BTW, I know that currently there already is the Interceptor#findDirty() method which
already allows for some custom dirty checking but the problem from a performance
point of view is that this method requires the entity's property values as parameter
which are retrieved in DefaultFlushEntityEventListener#getValues() which is the most
expensive method during flush. This drawback of the findDirty() method has often been
noticed in comments on the news groups.
I personally think it would be nice if something could be done to improve the
performance of flushing in Hibernate since from what I read on the news groups and
the like, flushing still seems to often lead to performance problems in practice,
especially in larger projects where it is often not easy to avoid flushes or to
keep the numer of entities in the session cache small. In fact, we are having quite
some trouble with that in our project and having some custom dirty checking like the
one I'm proposing here would greatly help in our project and in other projects as
well, I guess.
--
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, 1 month