[Hibernate-JIRA] Created: (HHH-5107) Fetched by fetch-profile results are lost outside of the session
by Elif Kurklu (JIRA)
Fetched by fetch-profile results are lost outside of the session
----------------------------------------------------------------
Key: HHH-5107
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5107
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.0-Final
Environment: [junit] 0 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.5.0-Final
[junit] 0 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
[junit] 16 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
[junit] 16 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
[junit] 78 [main] INFO org.hibernate.cfg.Configuration - configuring from url: file:/C:/Elif/Develop/ConFRM-Server/config/hibernate.hsqldb-cfg.xml
[junit] 125 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : hibernate-mappings/Authentication.hbm.xml
[junit] 203 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: gov.nasa.arc.confrm.authentication.User -> CONFRM_USER
[junit] 219 [main] INFO org.hibernate.cfg.HbmBinder - Mapping collection: gov.nasa.arc.confrm.authentication.User.roles -> CONFRM_USER_ROLES
[junit] 219 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: gov.nasa.arc.confrm.authentication.UserRole -> USER_ROLE
[junit] 219 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : hibernate-mappings/Constraint.hbm.xml
[junit] 234 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: gov.nasa.arc.confrm.constraint.ConstraintType -> CONSTRAINT_TYPE
[junit] 234 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: gov.nasa.arc.confrm.constraint.ConstraintStatus -> CONSTRAINT_STATUS
[junit] 250 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: gov.nasa.arc.confrm.constraint.Constraint -> CONSTRAINT
[junit] 344 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: gov.nasa.arc.confrm.constraint.SourceRecord -> SOURCE_RECORD
[junit] 344 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: gov.nasa.arc.confrm.constraint.CommentThread -> COMMENT_THREAD
[junit] 344 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: gov.nasa.arc.confrm.constraint.Comment -> COMMENT
[junit] 344 [main] INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null
[junit] 344 [main] INFO org.hibernate.cfg.HbmBinder - Mapping collection: gov.nasa.arc.confrm.constraint.Constraint.commentThreads -> COMMENT_THREAD
[junit] 344 [main] INFO org.hibernate.cfg.HbmBinder - Mapping collection: gov.nasa.arc.confrm.constraint.CommentThread.comments -> COMMENT
[junit] 344 [main] INFO org.hibernate.cfg.HbmBinder - Mapping collection: gov.nasa.arc.confrm.constraint.Comment.responses -> COMMENT
[junit] 1266 INFO [main] org.springframework.orm.hibernate3.LocalSessionFactoryBean - Building new Hibernate SessionFactory
[junit] 344 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
[junit] 344 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 1
[junit] 344 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false
[junit] 344 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:hsql://localhost/confrm
[junit] 344 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=sa, password=****}
[junit] 375 [main] INFO org.hibernate.cfg.SettingsFactory - RDBMS: HSQL Database Engine, version: 1.8.0
[junit] 375 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC driver: HSQL Database Engine Driver, version: 1.8.0
[junit] 391 [main] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.HSQLDialect
[junit] 406 [main] INFO org.hibernate.engine.jdbc.JdbcSupportLoader - Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
[junit] 406 [main] INFO org.hibernate.transaction.TransactionFactoryFactory - Transaction strategy: org.springframework.orm.hibernate3.SpringTransactionFactory
[junit] 406 [main] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC batch size: 15
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): disabled
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - Connection release mode: auto
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
[junit] 406 [main] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - Named query checking : enabled
[junit] 406 [main] INFO org.hibernate.cfg.SettingsFactory - Check Nullability in Core (should be disabled when Bean Validation is on): enabled
[junit] 438 [main] INFO org.hibernate.impl.SessionFactoryImpl - building session factory
[junit] > orderByFragment(order-by)
[junit] > sortSpecification({sort specification})
[junit] > sortKeySpecification(sort key)
[junit] > sortKey($PlaceHolder$.addedOn)
[junit] < sortKey(null)
[junit] < sortKeySpecification(null)
[junit] < sortSpecification(null)
[junit] < orderByFragment(null)
[junit] > orderByFragment(order-by)
[junit] > sortSpecification({sort specification})
[junit] > sortKeySpecification(sort key)
[junit] > sortKey($PlaceHolder$.addedOn)
[junit] < sortKey(null)
[junit] < sortKeySpecification(null)
[junit] < sortSpecification(null)
[junit] < orderByFragment(null)
[junit] > orderByFragment(order-by)
[junit] > sortSpecification({sort specification})
[junit] > sortKeySpecification(sort key)
[junit] > sortKey($PlaceHolder$.addedOn)
[junit] < sortKey(null)
[junit] < sortKeySpecification(null)
[junit] < sortSpecification(null)
[junit] < orderByFragment(null)
[junit] 625 [main] INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
[junit] 2063 INFO [main] org.springframework.jdbc.datasource.DriverManagerDataSource - Loaded JDBC driver: org.hsqldb.jdbcDriver
[junit] 2110 INFO [main] org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor - Validated configuration attributes
[junit] 2141 INFO [main] org.springframework.security.provisioning.JdbcUserDetailsManager - No authentication manager set. Reauthentication of users when changing passwords will not be performed.
[junit] 1266 [main] INFO org.hibernate.validator.util.Version - Hibernate Validator 4.0.2.GA
Reporter: Elif Kurklu
Created a fetch-profile on a lazy collection, and used it in server code. I can see the SQL statement running with proper join to load the collection objects. Yet, when I try to access the collection outside the session, I still get LazyInitializationException.
The data is fetched already, why is it dropped in favor of lazy loading?
I thought this was a great alternative to using Hibernate.initialize(). I would love it to work that way!
code with fetch profile:
public T load(PK id, String fetchProfile) {
Session s = getSession();
s.enableFetchProfile(fetchProfile);
T o = (T) s.load(type, id);
return o;
}
mapping file:
<class name="Constraint" table="CONSTRAINT">
<id name="id" type="int" access="field"><generator class="native"/></id>
<property name="number" type="string" not-null="true"/>
<property name="name" type="string" not-null="true"/>
<property name="versionName" type="string" not-null="true"/>
<set name="commentThreads" inverse="true" order-by="addedOn" lazy="true" cascade="all,delete-orphan" access="field">
<key column="constraint_id"/>
<one-to-many class="CommentThread"/>
</set>
<fetch-profile name="constraint-fetch">
<fetch association="commentThreads" style="join"/>
</fetch-profile>
</class>
--
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
16 years
[Hibernate-JIRA] Resolved: (HHH-1804) Empty 'FetchingScrollableResultsImpl' throws SQLException
by Gail Badner (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1804?page=c... ]
Gail Badner resolved HHH-1804.
------------------------------
Resolution: Fixed
Fixed in trunk and Branch_3_3.
I believe the attached patch will not work properly for some queries. Instead, I added a check for an empty ResultSet to FetchingScrollableResultsImpl.next().
You can see details at http://opensource.atlassian.com/projects/hibernate/browse/HHH-1804?page=c... when JIRA syncs up the commit.
> Empty 'FetchingScrollableResultsImpl' throws SQLException
> ---------------------------------------------------------
>
> Key: HHH-1804
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1804
> Project: Hibernate Core
> Issue Type: Bug
> Reporter: Maarten Winkels
> Assignee: Gail Badner
> Attachments: EmptyFetchJoinScrollTest.java, scroll-join-fetch-empty.patch
>
>
> When scrolling a HQL query with join fetch on a collection, that doesn't return any results, the following execption occurs:
> org.hibernate.exception.GenericJDBCException: could not perform sequential read of results (forward)
> at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
> at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
> at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
> at org.hibernate.loader.Loader.loadSequentialRowsForward(Loader.java:386)
> at org.hibernate.impl.FetchingScrollableResultsImpl.next(FetchingScrollableResultsImpl.java:55)
> at org.hibernate.test.joinfetch.EmptyFetchJoinScrollTest.testFetchJoinEmptyScroll(EmptyFetchJoinScrollTest.java:21)
> 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:585)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at org.hibernate.test.TestCase.runTest(TestCase.java:161)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> Caused by: java.sql.SQLException: No data is available
> at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
> at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.checkAvailable(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.getColumnInType(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.getString(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.getString(Unknown Source)
> at org.hibernate.type.StringType.get(StringType.java:18)
> at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:113)
> at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:102)
> at org.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:1088)
> at org.hibernate.loader.Loader.loadSequentialRowsForward(Loader.java:375)
> ... 18 more
--
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
16 years
[Hibernate-JIRA] Created: (HSEARCH-320) Hibernate Search conflicts with Spring's class path scanning
by Paul Middelkoop (JIRA)
Hibernate Search conflicts with Spring's class path scanning
------------------------------------------------------------
Key: HSEARCH-320
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-320
Project: Hibernate Search
Issue Type: Bug
Affects Versions: 3.1.0.GA, 3.1.0.CR1
Reporter: Paul Middelkoop
Hibernate Search conflicts with Spring's class path scanning. When Hibernate Search is on the classpath Spring throws an exception while reading annotation metadata.
3.1.0 Beta1 and 3.0.x versions had no problems.
Stacktrace:
Caused by: java.lang.ArrayIndexOutOfBoundsException: 50432
at org.springframework.asm.ClassReader.readUTF8(Unknown Source)
at org.springframework.asm.ClassReader.accept(Unknown Source)
at org.springframework.asm.ClassReader.accept(Unknown Source)
at org.springframework.core.type.classreading.SimpleMetadataReader.getAnnotationMetadata(SimpleMetadataReader.java:55)
at org.springframework.core.type.filter.AnnotationTypeFilter.matchSelf(AnnotationTypeFilter.java:68)
at org.springframework.core.type.filter.AbstractTypeHierarchyTraversingFilter.match(AbstractTypeHierarchyTraversingFilter.java:55)
at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.isCandidateComponent(ClassPathScanningCandidateComponentProvider.java:224)
at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:182)
at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:201)
at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:85)
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1255)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1245)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
--
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
16 years
[Hibernate-JIRA] Created: (HHH-4864) "Cannot read files twice on NativeScanner" exception when using multiple persistence.xml
by Bouiaw (JIRA)
"Cannot read files twice on NativeScanner" exception when using multiple persistence.xml
----------------------------------------------------------------------------------------
Key: HHH-4864
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4864
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.0-Beta-3
Reporter: Bouiaw
When subclassing DefaultPersistenceUnitManager as described in http://ancientprogramming.blogspot.com/2007/05/multiple-persistencexml-fi... in order to have my entities in different jars, Hibernate 3.5-Beta3 throw the following exception (it worked with previous version of Hibernate) :
java.lang.RuntimeException: error trying to scan <jar-file>: file:/Users/bouiaw/resthub/resthub-core/target/classes/
at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:700)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:465)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:165)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:225)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:288)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1457)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1397)
... 51 more
Caused by: org.hibernate.AssertionFailure: Cannot read files twice on NativeScanner
at org.hibernate.ejb.packaging.NativeScanner.getFilesInJar(NativeScanner.java:168)
at org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:393)
at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:697)
... 57 more
--
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
16 years