[Hibernate-JIRA] Created: (HCANN-44) member name collides with SQL request
by Paul Bernard AMADE (JIRA)
member name collides with SQL request
-------------------------------------
Key: HCANN-44
URL: https://hibernate.onjira.com/browse/HCANN-44
Project: Hibernate Commons Annotations
Issue Type: Bug
Affects Versions: 4.0.1.Final
Environment: mysql driver
Reporter: Paul Bernard AMADE
a description like this one:
----------------------------------
@Entity
public class DeploymentDescriptor implements Serializable {
@Id
@GeneratedValue
private long id;
@NaturalId
private String key ;
//+getter + setters
}
--------------------------------------
does not fire any Exception though it generates an illegal request underneath
-----------------------------------------
create table DeploymentDescriptor (
id bigint not null auto_increment,
key varchar(255),
primary key (id),
unique (key)
)
-----------------------------------------
the result is that the table jsut does not appear in the database
and programmer is not warned.
the names of classes and members should not collide with reserved words underneath!
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years
[Hibernate-JIRA] Created: (HHH-7175) Possible problem with org.hibernate.engine.query.HQLQueryPlan
by Imrich Olha (JIRA)
Possible problem with org.hibernate.engine.query.HQLQueryPlan
-------------------------------------------------------------
Key: HHH-7175
URL: https://hibernate.onjira.com/browse/HHH-7175
Project: Hibernate ORM
Issue Type: Bug
Components: core
Environment: hibernate-core-3.3.2.GA.jar, Oracle DB, Java(TM) SE Runtime Environment (build 1.6.0_31-b04)
Reporter: Imrich Olha
Priority: Minor
I wrote a simple 'polymorphic' queryString for org.hibernate.Query based on interface implemented by three other classes.
I set restriction on size (maxRows) too.
But when I executed that query, I found that some records where missing in returned list.
I debugged sources and found possible issue in org.hibernate.engine.query.HQLQueryPlan in method
public List performList(QueryParameters queryParameters, SessionImplementor session) throws HibernateException { ... }
specifically in branch for restricted (needsLimit) polymorphic query executing:
**************************************************************************************
int includedCount = -1;
translator_loop: for ( int i = 0; i < translators.length; i++ ) {
List tmp = translators[i].list( session, queryParametersToUse );
if ( needsLimit ) {
// NOTE : firstRow is zero-based
int first = queryParameters.getRowSelection().getFirstRow() == null
? 0
: queryParameters.getRowSelection().getFirstRow().intValue();
int max = queryParameters.getRowSelection().getMaxRows() == null
? -1
: queryParameters.getRowSelection().getMaxRows().intValue();
final int size = tmp.size();
for ( int x = 0; x < size; x++ ) {
final Object result = tmp.get( x );
if ( ! distinction.add( result ) ) {
continue;
}
includedCount++;
if ( includedCount < first ) {
continue;
}
combinedResults.add( result );
if ( max >= 0 && includedCount > max ) {
// break the outer loop !!!
break translator_loop;
}
}
}
else {
combinedResults.addAll( tmp );
}
}
**************************************************************************************
or when I simplyfy the issue :
int includedCount = -1;
for ( int x = 0; x < size; x++ ) {
final Object result = tmp.get( x );
includedCount++;
combinedResults.add( result );
if ( max >= 0 && includedCount > max ) {
// break the outer loop !!!
break translator_loop;
}
}
for example let start with max = 1;
before for we start with includedCount = -1; x is undefined; combinedResults is empty;
after 1. iteration: includedCount = 0; x = 0; combinedResults contains 1 item; test 'if ( max >= 0 && includedCount > max )' allows another iteration.
after 2. iteration: includedCount = 1; x = 1; combinedResults contains 2 items; test 'if ( max >= 0 && includedCount > max )' allows another iteration.
after 3. iteration: includedCount = 2; x = 2; combinedResults contains 3 items; test 'if ( max >= 0 && includedCount > max )' BREAKS another iteration.
so we will finished with 3 items in combinedResults list, but requires only max = 1;
**************************************************************************************
And this is (I suppose) my problem of missing records (in next iteration in our PagedDataSource) :)
It is correct ?
Imrich Olha
Ps. Sorry my bad english :(
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years
[Hibernate-JIRA] Created: (JPA-29) Hibernate Throw Memory Leak error when loading 206940 entity objects into JSF page
by Larry (JIRA)
Hibernate Throw Memory Leak error when loading 206940 entity objects into JSF page
----------------------------------------------------------------------------------
Key: JPA-29
URL: https://hibernate.onjira.com/browse/JPA-29
Project: Java Persistence API
Issue Type: Bug
Environment: JBoss 7.1.1
Reporter: Larry
javax.servlet.ServletException: Java heap space
javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
root cause
java.lang.OutOfMemoryError: Java heap space
org.hibernate.type.descriptor.java.JdbcTimestampTypeDescriptor$TimestampMutabilityPlan.deepCopyNotNull(JdbcTimestampTypeDescriptor.java:51)
org.hibernate.type.descriptor.java.JdbcTimestampTypeDescriptor$TimestampMutabilityPlan.deepCopyNotNull(JdbcTimestampTypeDescriptor.java:45)
org.hibernate.type.descriptor.java.MutableMutabilityPlan.deepCopy(MutableMutabilityPlan.java:57)
org.hibernate.type.AbstractStandardBasicType.deepCopy(AbstractStandardBasicType.java:340)
org.hibernate.type.AbstractStandardBasicType.deepCopy(AbstractStandardBasicType.java:336)
org.hibernate.type.TypeHelper.deepCopy(TypeHelper.java:67)
org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:241)
org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:995)
org.hibernate.loader.Loader.doQuery(Loader.java:874)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289)
org.hibernate.loader.Loader.doList(Loader.java:2447)
org.hibernate.loader.Loader.doList(Loader.java:2433)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2263)
org.hibernate.loader.Loader.list(Loader.java:2258)
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:470)
org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355)
org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:196)
org.hibernate.internal.SessionImpl.list(SessionImpl.java:1161)
org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:252)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:310)
$Proxy90.getResultList(Unknown Source)
com.pimco.tc.service.EtpEmployeeTradeServiceImpl.findAll(EtpEmployeeTradeServiceImpl.java:28)
com.pimco.tc.jsf.bean.EmployeeTradeBean.getJpaAllEmployeeTrades(EmployeeTradeBean.java:65)
com.pimco.tc.jsf.bean.EmployeeTradeBean.<init>(EmployeeTradeBean.java:35)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years
[Hibernate-JIRA] Created: (HHH-7180) Reattaching a collection whose owner uses a primitive array primary key fails with "reassociated object has dirty collection reference"
by Steve Ash (JIRA)
Reattaching a collection whose owner uses a primitive array primary key fails with "reassociated object has dirty collection reference"
---------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-7180
URL: https://hibernate.onjira.com/browse/HHH-7180
Project: Hibernate ORM
Issue Type: Bug
Components: core
Environment: Hibernate 3.6.4
MSSQL 2008
Reporter: Steve Ash
We have a Parent class with @Id of type byte[] and a Child class also with @Id of type byte[]. There is a bidirectional @OneToMany relationship "List<Child> getChildren()" in Parent with Cascade.ALL and FetchType.EAGER.
We load a parent (eagerly loading its children) and detach this instance from the session. We later want to re-attach the parent + children insteances by using the Lock API with LockMode.NONE.
This fails with:
{panel}
org.hibernate.HibernateException: reassociated object has dirty collection reference
at org.hibernate.event.def.OnLockVisitor.processCollection(OnLockVisitor.java:71)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:122)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:83)
at org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:77)
at org.hibernate.event.def.AbstractVisitor.process(AbstractVisitor.java:144)
at org.hibernate.event.def.AbstractReassociateEventListener.reassociate(AbstractReassociateEventListener.java:101)
at org.hibernate.event.def.DefaultLockEventListener.onLock(DefaultLockEventListener.java:82)
at org.hibernate.impl.SessionImpl.fireLock(SessionImpl.java:774)
at org.hibernate.impl.SessionImpl.fireLock(SessionImpl.java:766)
at org.hibernate.impl.SessionImpl.access$600(SessionImpl.java:156)
at org.hibernate.impl.SessionImpl$LockRequestImpl.lock(SessionImpl.java:2369)
at com.argodata.fser.data.BlockManTest.testSimpleUpdate(BlockManTest.java:160)
{panel}
The problem is that {{ProxyVisitor}}'s {{isOwnerUnchanged}} uses id.equals( snapshot.getKey() ) to validate the the PersistentCollections snapshot owner id value is "equal" to the current id. For primitve keys like long and int this works, but for byte[] keys it fails as its a reference equals operation, not a value equals. If we switch our id type to long then we can re-attach the parent and children with the lock API as expected.
Workaround is simple of course, just don't use array types for @Ids or wrap them with something that implements equals properly. However, considering that I believe primary arrays as keys are handled properly in other places, so I would guess that this is just an inconistency and that it should work as expected in ProxyVisitor as well.
I will attach a TestCase replicating the problem shortly.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years
[Hibernate-JIRA] Created: (HHH-7178) Null Identifier for maps.....dependent on variable name
by Marc (JIRA)
Null Identifier for maps.....dependent on variable name
-------------------------------------------------------
Key: HHH-7178
URL: https://hibernate.onjira.com/browse/HHH-7178
Project: Hibernate ORM
Issue Type: Bug
Components: core
Affects Versions: 4.0.1
Environment: Oracle10g
Reporter: Marc
Attachments: HibernateJIRA.zip
When querying for a class which contains a self-reference and a Map whose values contain a composite primary key, a null identifier exception is thrown. It seems to be somehow related to the variable name because when I change MyEntity.secConfigs to MyEntity.ecConfigs and change the setters/getters appropriately, the problem no longer exists. I believe the problem is also related to the composite primary key for ContainedEntity because when I change it to use an auto-generated long the problem also goes away.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years