[Hibernate-JIRA] Created: (OGM-112) ConcurrentModificationException while loading associations under load
by Sanne Grinovero (JIRA)
ConcurrentModificationException while loading associations under load
---------------------------------------------------------------------
Key: OGM-112
URL: http://opensource.atlassian.com/projects/hibernate/browse/OGM-112
Project: Hibernate OGM
Issue Type: Bug
Reporter: Sanne Grinovero
{quote}class: class java.util.ConcurrentModificationException
cause: null
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)
at java.util.HashMap$KeyIterator.next(HashMap.java:828)
at java.util.AbstractCollection.addAll(AbstractCollection.java:305)
at org.hibernate.ogm.datastore.spi.Association.getKeys(Association.java:132)
at org.hibernate.ogm.loader.OgmLoader.getResultSet(OgmLoader.java:417)
at org.hibernate.ogm.loader.OgmLoader.doQuery(OgmLoader.java:248)
at org.hibernate.ogm.loader.OgmLoader.doQueryAndInitializeNonLazyCollections(OgmLoader.java:215)
at org.hibernate.ogm.loader.OgmLoader.loadCollection(OgmLoader.java:185)
at org.hibernate.ogm.loader.OgmBasicCollectionLoader.initialize(OgmBasicCollectionLoader.java:42)
at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:622)
at org.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:82)
at org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:1606)
at org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:379)
at org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:112)
at org.hibernate.collection.internal.PersistentSet.iterator(PersistentSet.java:180){quote}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 6 months
[Hibernate-JIRA] Created: (HHH-4915) <list-index> base attribute ignored on insert for a bidirectional association (one-to-many)
by Olivier Lafontaine (JIRA)
<list-index> base attribute ignored on insert for a bidirectional association (one-to-many)
-------------------------------------------------------------------------------------------
Key: HHH-4915
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4915
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.0-CR-1, 3.3.2
Environment: Hibernate 3.3.2GA and 3.5.0-CR-1
Oracle Database
Reporter: Olivier Lafontaine
Attachments: hibernate-poc-jira.zip
My mapping looks like the following:
{code:xml}
<hibernate-mapping>
<class name="Parent">
<!-- SNIP -->
<list name="children" table="CHILD" cascade="all-delete-orphan">
<key column="ID_PARENT" not-null="true" />
<list-index base="1">
<column name="IDX" check="IDX > 0" />
</list-index>
<one-to-many class="Child" />
</list>
</class>
<class name="Child">
<!-- SNIP -->
<many-to-one name="parent" class="Parent" column="ID_PARENT"
not-null="true" insert="false" update="false" />
</class>
</hibernate-mapping>
{code}
As you can see from the mapping, we have a parent entity ({{Parent}}) referring child entities ({{Child}} using the {{children}} accessor). The index column ({{ORDER}}) is not an attribute in the child entity, so I referred to the second use case in section _6.3.3. Bidirectional associations with indexed collections_ of the reference guide to do my mapping.
Everything works except for the index base, it is always 0 based on insert. I've tried both Hibernate 3.3.2GA and the latest development version (3.5.0-CR-1), the issue can be reproduced in both.
I've joined a test case to reproduce the problem. While working on it, I realized there are updates after the inserts setting the correct index. However, we cannot change the database schema and there's a constraint on the index column enforcing a value > 0. So this issue is really important for us. I could manually handle the index values, but it would be so much easier to let Hibernate do it.
I've traced the problem and it seems that {{StatefulPersistenceContext#getIndexInParent(..)}} does not considers the index base. Why are updates necessary after the inserts? It looks to me like Hibernate could correctly set the index parameter on the insert statements.
--
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
12 years, 6 months
[Hibernate-JIRA] Created: (HHH-5072) Invalid SQL produced when using FetchMode.SUBSELECT with SQLServerDialect
by kabram (JIRA)
Invalid SQL produced when using FetchMode.SUBSELECT with SQLServerDialect
-------------------------------------------------------------------------
Key: HHH-5072
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5072
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.0-Final
Environment: Hibernate core 3.5, JPA 2.0, SQL Server 2005, JDK 1.6
Reporter: kabram
Priority: Blocker
I have a parent entity with child entities being loaded using SubSelect and eager fetching. I execute a query to retrieve all parents and get the following query which SQL Server 2005 does not support:
select
childtab0_.CONFIG_KEY as CONFIG5_23_1_,
childtab0_.QUALIFIER as QUALIFIER23_1_,
childtab0_.CONFIG_VALUE_ID as CONFIG1_1_,
childtab0_.CONFIG_VALUE_ID as CONFIG1_24_0_,
childtab0_.CONFIG_KEY as CONFIG5_24_0_,
childtab0_.QUALIFIER as QUALIFIER24_0_,
childtab0_.CONFIG_VALUE as CONFIG2_24_0_,
childtab0_.IS_ENCRYPTED as IS3_24_0_,
childtab0_.LIST_ORDER as LIST4_24_0_
from
TEST_CHILD_TABLE childtab0_
where
(childtab0_.CONFIG_KEY, childtab0_.QUALIFIER) in
(select parenttab0_.CONFIG_KEY, parenttab0_.QUALIFIER
from RSS_NEO_CANYON_CONFIG_KEY parenttab0_ )
order by
childtab0_.LIST_ORDER asc
SQL Server does not like the tuple in the where clause.
--
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
12 years, 6 months
[Hibernate-JIRA] Created: (HCANN-30) EntityBinder: Incorrect WARN message about dynamicUpdate ("Entity used on a non root entity: ignored for...")
by Shahaf Abileah (JIRA)
EntityBinder: Incorrect WARN message about dynamicUpdate ("Entity used on a non root entity: ignored for...")
-------------------------------------------------------------------------------------------------------------
Key: HCANN-30
URL: http://opensource.atlassian.com/projects/hibernate/browse/HCANN-30
Project: Hibernate Commons Annotations
Issue Type: Bug
Reporter: Shahaf Abileah
Priority: Minor
This my first bug so please excuse any mistakes I make in filing it, and help me correct them.
I'm using PostgreSQL. I have a bunch of domain objects. Some of them are small class hierarchies. I chose to map each class hierarchy to a single table using a discriminator column. Here's one example where I have a base class (Note) and a subclass (TaskNote)...
@Entity
@org.hibernate.annotations.Entity(dynamicUpdate = true)
@Table(name = "notes")
@SequenceGenerator(name = "notes_note_id_seq", sequenceName = "notes_note_id_seq", allocationSize = 1)
@Proxy(lazy = true)
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@SQLDelete(sql="update notes set removed = true where note_id = ?")
@DiscriminatorColumn(
name=Note.noteTypeColumnName,
discriminatorType=DiscriminatorType.INTEGER
)
public abstract class Note implements Persistable {
...
}
@Entity
@org.hibernate.annotations.Entity(dynamicUpdate = true)
@Proxy(lazy = true)
@DiscriminatorValue("1")
public class TaskNote extends Note {
...
}
Notice that I added the following annotation to both: @org.hibernate.annotations.Entity(dynamicUpdate = true)
I did this because I want to keep my updates lean.
After adding this annotation I started seeing warnings in my log:
2010-11-01 10:03:22,210 WARN org.hibernate.cfg.annotations.EntityBinder @org.hibernate.annotations.Entity used on a non root entity: ignored for redfin.core.domain.TaskNote
I spent some time experimenting with this annotation to understand how it works with class hierarchies. I discovered that:
* If I put the annotation on the child class and not on the parent class, then I get the WARN but dynamicUpdate still works
* If I put the annotation on the parent class and not the child class, then the WARN goes away but dynamicUpdate does not work
* If I put the annotation on both, then the WARN is there and dynamicUpdate works
To me this implies that the WARN is incorrect. Do you agree?
I believe this is the code that is generating the message:
http://www.docjar.com/html/api/org/hibernate/cfg/annotations/EntityBinder...
Here are the particular versions of the various hibernate libraries that I'm using:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>3.0.0.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.7.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.3.0.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>3.3.0.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>antlr</artifactId>
<version>2.7.5H3</version>
</dependency>
--
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
12 years, 6 months
[Hibernate-JIRA] Created: (HHH-2666) subselect fetching ignores max results
by James Roper (JIRA)
subselect fetching ignores max results
--------------------------------------
Key: HHH-2666
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2666
Project: Hibernate3
Issue Type: Improvement
Components: query-hql, query-sql
Affects Versions: 3.2.1
Environment: Hibernate 3.2.1
HSQLDB 8.0
Reporter: James Roper
Priority: Minor
When maxResults is set for a query, the hibernate subselect fetching strategy ignores it. For example, I have a class entry, that has a list of comments, which are configured to use the subselect fetching strategy. You can see that in the original query, only the top ? results are fetched:
select
top ? entry0_.id as id0_,
entry0_.title as title0_,
entry0_.entry as entry0_,
entry0_.time as time0_,
entry0_.category_id as category5_0_
from
Entry entry0_
order by
entry0_.time desc
But then when it does the sub select query to lazily load the comments, this is the query it runs:
select
comments0_.entry_id as entry5_1_,
comments0_.id as id1_,
comments0_.id as id1_0_,
comments0_.time as time1_0_,
comments0_.comment as comment1_0_,
comments0_.author as author1_0_
from
Comment comments0_
where
comments0_.entry_id in (
select
entry0_.id
from
Entry entry0_
)
order by
comments0_.time desc
So, it loads every single comment in the database, even though only the comments for the top ? entries are needed. Of course, if there was no order by clause on the first query, the sub select may not return the same results, so it should probably only do this when there is an order by clause in the first query, and it should make sure it includes the order by clause in the sub select.
--
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
12 years, 6 months
[Hibernate-JIRA] Created: (ANN-609) Need a way to specify "unsaved-value" strategy using annotations
by Suji Suresh (JIRA)
Need a way to specify "unsaved-value" strategy using annotations
----------------------------------------------------------------
Key: ANN-609
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-609
Project: Hibernate Annotations
Issue Type: Bug
Environment: Hibernate 3.2.2, Hibernate-annotations 3.2.1
Reporter: Suji Suresh
Hibernate has two ways of specifying a value for primary key:
1. Assign a value before handing it over to Hibernate
2. Have Hibernate generate the value before persisting
In my project I have objects of both of the above specified types. In other words I assign value for the primary key for some the objects (lets call these objects "assigned") and for others I have Hibernate generate the value before persisting (lets call these objects "generated"). Since Hibernate annotations does not support "unsaved-value", I do not have a way of specifying "unsaved-value" strategy. While my "generated" objects work perfectly with Hibernate's default "unsaved-value" strategy, I see wrong (but expected) behaviour when I try to persist an "assigned" object that is already present in the database in that, I get StaleStateException instead of DataIntegrityViolationException
--
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
12 years, 6 months
[Hibernate-JIRA] Created: (HHH-6632) Improve exception message when package-info / other file is missing @ metadatasources.buildMetadata()
by Elmer van Chastelet (JIRA)
Improve exception message when package-info / other file is missing @ metadatasources.buildMetadata()
-----------------------------------------------------------------------------------------------------
Key: HHH-6632
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6632
Project: Hibernate Core
Issue Type: Improvement
Components: metamodel
Affects Versions: 4.0.0.CR2
Reporter: Elmer van Chastelet
While migrating our project to the new Hibernate Core 4.0, I came across an exception which was thrown during metadatasources.buildMetadata(). Emmanuel helped me to find the cause, which were the missing package-info.java files for the packages I add to the MetadataSources object. If possible, improve this exception message to include info about the file that fails to load.
{code}
Sep 5, 2011 4:17:46 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet mainservlet
java.io.IOException: Stream closed
at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:151)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
at java.io.DataInputStream.readFully(DataInputStream.java:195)
at java.io.DataInputStream.readFully(DataInputStream.java:169)
at org.jboss.jandex.Indexer.verifyMagic(Indexer.java:387)
at org.jboss.jandex.Indexer.index(Indexer.java:628)
at org.hibernate.metamodel.source.annotations.AnnotationMetadataSourceProcessorImpl.indexClass(AnnotationMetadataSourceProcessorImpl.java:159)
at org.hibernate.metamodel.source.annotations.AnnotationMetadataSourceProcessorImpl.prepare(AnnotationMetadataSourceProcessorImpl.java:85)
at org.hibernate.metamodel.source.internal.MetadataImpl.prepare(MetadataImpl.java:180)
at org.hibernate.metamodel.source.internal.MetadataImpl.<init>(MetadataImpl.java:165)
at org.hibernate.metamodel.source.internal.MetadataBuilderImpl.buildMetadata(MetadataBuilderImpl.java:83)
at org.hibernate.metamodel.MetadataSources.buildMetadata(MetadataSources.java:112)
at utils.HibernateUtilConfigured.<clinit>(HibernateUtilConfigured.java:60)
at utils.DispatchServlet.tryLoadGlobalsAndPerformInit(DispatchServlet.java:19)
at utils.DispatchServlet.init(DispatchServlet.java:39)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:679)
{code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 6 months