[Hibernate-JIRA] Created: (HHH-2862) Collection is not associated with any session exception when doing an eager fetch on a non-unique collection.
by Paul Andrews (JIRA)
Collection is not associated with any session exception when doing an eager fetch on a non-unique collection.
-------------------------------------------------------------------------------------------------------------
Key: HHH-2862
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2862
Project: Hibernate3
Issue Type: Bug
Environment: Hibernate 3.1.3 - Hibernate 3.2.5, HSQLDB, Java5
Reporter: Paul Andrews
It is basically caused by having an eager collection where the key of the collection is not unique in the results.
The code works as follows in CollectionType.getCollection():
....
persistenceContext.addUninitializedCollection( persister, collection, key );
// some collections are not lazy:
if ( initializeImmediately( entityMode ) ) {
session.initializeCollection( collection, false );
}
else if ( !persister.isLazy() ) {
persistenceContext.addNonLazyCollection( collection );
}
if ( hasHolder( entityMode ) ) {
session.getPersistenceContext().addCollectionHolder( collection );
}
if persistenceContext.addUninitializedCollection() detects that the collection with the given key has already been added it clears the session on the old instance of the collection (sets it to null). However, that collection has already been added to the persistence context by an earlier call to this method. So later when StatefulPersistenceContext.initializeNonLazyCollections() is called it iterates through all of the collections in the persistence context (including those which have had their session set to null by addUninitializedCollection()), calling forceInitialization() which throws a 'collection is not associated with any session' exception.
--
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, 10 months
[Hibernate-JIRA] Created: (HHH-1985) NodeTraverser is not SOE-safe
by Sergey Vladimirov (JIRA)
NodeTraverser is not SOE-safe
-----------------------------
Key: HHH-1985
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1985
Project: Hibernate3
Type: Improvement
Components: core
Versions: 3.2.0.cr3
Reporter: Sergey Vladimirov
Priority: Minor
org.hibernate.hql.ast.util.NodeTraverser
It is possible for java.lang.StackOverflowError to occur in NodeTraverser.java:41;42 with very deep tree. Need another algorith to visit whole tree.
08.08 19:50:09 ERROR [ArpSiteServlet] Servlet.service() for servlet ArpSiteServlet threw exception
java.lang.StackOverflowError
at org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(NodeTraverser.java:41)
at org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(NodeTraverser.java:41)
at org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(NodeTraverser.java:42)
at org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(NodeTraverser.java:42)
at org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(NodeTraverser.java:42)
at org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(NodeTraverser.java:42)
--
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, 10 months
[Hibernate-JIRA] Created: (HHH-2288) Adding a new ResultTransformer, permitting to instantiate and fill related beans and not to take care of aliases case.
by Nicolas Billard (JIRA)
Adding a new ResultTransformer, permitting to instantiate and fill related beans and not to take care of aliases case.
----------------------------------------------------------------------------------------------------------------------
Key: HHH-2288
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2288
Project: Hibernate3
Type: Improvement
Components: query-sql, query-hql, query-criteria
Versions: 3.2.1
Environment: Developped based on hibernate v 3.2.1
Reporter: Nicolas Billard
Priority: Minor
Attachments: ResultTransformerImprovement.zip
Are joined to this post 2 classes. Below is the javadoc header of the ResultTransformer class.
May be this could be integrated in next hibernate versions ( certainly with improvements ... :p )
Let me know if anyone finds it useful ...
------------------------------------------------------
* Transforms resultset to value a bean, via setters.
*
* Examples:
*
* bean MyBean as 2 setters :
* - setId : takes an Integer
* - setProduct : takes a Product bean
*
* Product bean as 2 setters :
* - setId
* - setLib
*
* resultset may have these columns :
* - ID
* - PRODUCT_ID
* - PRODUCT_LIB
*
* A MyBean instance will be created for each tupple,
* and a Product instance will be also created, filled with PRODUCT_ID and PRODUCT_LIB values.
--
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, 10 months