[Hibernate-JIRA] Created: (HHH-4614) Instrumented model with abstract MappedSuperclass and field access doesn't work
by Anthony Patricio (JIRA)
Instrumented model with abstract MappedSuperclass and field access doesn't work
-------------------------------------------------------------------------------
Key: HHH-4614
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4614
Project: Hibernate Core
Issue Type: Bug
Components: annotations
Affects Versions: 3.5.0-Beta-2, 3.3.2
Reporter: Anthony Patricio
Attachments: testcase.zip
Notes:
- test runs fine with cglib, hb 3.2.4 SP1 + ann 3.2.1
- test runs fine with cglib, plain mapping files (trunk).
- no matter if you use annotation or mapping files, test will fail using javassist (it used to fail with previous version too)
So focus on instrumentation done using cglib.
See attached testcase to reproduce the problem.
Guideline:
- testcase is a duplication of what is tested in hb-core, just using annotations
- run org.hibernate.test.instrument2.runtime.CGLIBInstrumentationTest
- easy to switch from annotation to mapping files in org.hibernate.test.instrument2.cases.AbstractExecutable (comment/uncomment specific lines in getAnnotatedClasses and getXmlFiles)
interesting point: if you complete the source with id setters + annotate the getters (instead of fields) + make the getInterestRate @Transient, the test passes.
--
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, 9 months
[Hibernate-JIRA] Created: (HHH-4695) Some annotations tests in IndexedCollectionTest fail due to "foreign key constraint" failure on MySQL InnoDB
by Strong Liu (JIRA)
Some annotations tests in IndexedCollectionTest fail due to "foreign key constraint" failure on MySQL InnoDB
-------------------------------------------------------------------------------------------------------------
Key: HHH-4695
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4695
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.0-Beta-2, 3.5.0.Beta-1, 3.3.2, 3.2.4.sp1
Environment: MySQL InnoDB 5.0.x and 5.1.x
Reporter: Strong Liu
Test following tests are failing due to "foreign key constraint fail" in MySQL:
org.hibernate.test.annotations.indexcoll.IndexedCollectionTest.testDefaultMapKey
org.hibernate.test.annotations.indexcoll.IndexedCollectionTest.testMapKeyToEntity
org.hibernate.test.annotations.indexcoll.IndexedCollectionTest.testComponentSubPropertyMapKey
org.hibernate.test.annotations.indexcoll.IndexedCollectionTest.testMapKeyEntityEntity
Sample stack trace of the failure:
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:254)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:237)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.hibernate.test.annotations.indexcoll.IndexedCollectionTest.testDefaultMapKey(Unknown Source)
at org.hibernate.test.annotations.TestCase.runTest(Unknown Source)
Caused by: java.sql.BatchUpdateException: Cannot add or update a child row: a foreign key constraint fails (`platformae/addressentry`, CONSTRAINT `FK181B28FE1355AC4A` FOREIGN KEY (`firstname`, `lastname`) REFERENCES `addressentry` (`firstname`, `lastname`))
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:665)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:247)
---------
these testes only fail on MySQL5InnoDBDialect AND MySQLInnoDBDialect, they pass MySQL5Dialect and MySQLDialect
--
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, 9 months
[Hibernate-JIRA] Created: (HHH-3945) Envers using inheritance gives NullPointer
by robbie123456 (JIRA)
Envers using inheritance gives NullPointer
------------------------------------------
Key: HHH-3945
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3945
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.5
Environment: 3.2.6.ga
Oracle 10g
Reporter: robbie123456
Using Envers version 3.5.0-SNAPSHOT:
class A extends from B. They both have @Entity and B has with @Inheritance(strategy=InheritanceType.JOINED), so fields in the subclass A have a separate table.
When only setting A to @Audited, I get following NullPointerException (found closed JIRA ticket: https://jira.jboss.org/jira/browse/ENVERS-71):
Caused by: java.lang.NullPointerException
at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.generateInheritanceMappingData(AuditMetadataGenerator.java:253)
at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.generateFirstPass(AuditMetadataGenerator.java:301)
at org.hibernate.envers.configuration.EntitiesConfigurator.configure(EntitiesConfigurator.java:87)
at org.hibernate.envers.configuration.AuditConfiguration.<init>(AuditConfiguration.java:86)
at org.hibernate.envers.configuration.AuditConfiguration.getFor(AuditConfiguration.java:99)
at org.hibernate.envers.event.AuditEventListener.initialize(AuditEventListener.java:259)
at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:356)
at org.hibernate.cfg.Configuration.getInitializedEventListeners(Configuration.java:1304)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:732)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1368)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334)
... 39 more
NullPointerException happens here because 'entitiesConfigurations' is empty:
String parentEntityName = pc.getSuperclass().getEntityName();
ExtendedPropertyMapper parentPropertyMapper = entitiesConfigurations.get(parentEntityName).getPropertyMapper();
When also putting @Audited to the superclass B, I get following exception (also found on Hibernate JIRA ticket: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3647):
org.hibernate.HibernateException: instance not of expected entity type: java.util.HashMap is not a: B_AUD
at org.hibernate.persister.entity.AbstractEntityPersister.getSubclassEntityPersister(AbstractEntityPersister.java:3635)
at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1347)
at org.hibernate.id.Assigned.generate(Assigned.java:28)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:99)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
at org.hibernate.envers.synchronization.work.ModWorkUnit.perform(ModWorkUnit.java:60)
at org.hibernate.envers.synchronization.AuditSync.executeInSession(AuditSync.java:126)
at org.hibernate.envers.synchronization.AuditSync.beforeCompletion(AuditSync.java:150)
at org.hibernate.transaction.JDBCTransaction.notifyLocalSynchsBeforeTransactionCompletion(JDBCTransaction.java:228)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:109)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:655)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:709)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:678)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at net.x.prl.services.common.audit.UserAuditInterceptor.invoke(UserAuditInterceptor.java:32)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at net.x.prl.services.common.ServiceExceptionInterceptor.invoke(ServiceExceptionInterceptor.java:34)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy114.updateQuantityOnSalesForecastLine(Unknown Source)
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 org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(RemoteInvocationTraceInterceptor.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy114.updateQuantityOnSalesForecastLine(Unknown Source)
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 org.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:205)
at org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(DefaultRemoteInvocationExecutor.java:38)
at org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:78)
at net.x.buildit.middleware.jms.lingo.listener.EndpointExporterMessageListener.invokeAndCreateResult(EndpointExporterMessageListener.java:151)
at net.x.buildit.middleware.jms.lingo.listener.EndpointExporterMessageListener.doInvoke(EndpointExporterMessageListener.java:106)
at org.logicblaze.lingo.jms.JmsServiceExporterMessageListener.onMessage(JmsServiceExporterMessageListener.java:102)
at net.x.buildit.middleware.jms.lingo.listener.EndpointExporterMessageListener.onMessage(EndpointExporterMessageListener.java:220)
at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:531)
at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:466)
at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:435)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:260)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:944)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:868)
at java.lang.Thread.run(Thread.java:595)
Using Envers with entity classes without inheriting from another entity, gives no problem.
--
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, 9 months
[Hibernate-JIRA] Created: (HHH-4557) Query stealing connection from another query
by Beto Neto (JIRA)
Query stealing connection from another query
--------------------------------------------
Key: HHH-4557
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4557
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.2.6
Environment: 3.2.6.ga, Oracle 10, Windows XP sp3
Reporter: Beto Neto
To reproduce the bug:
Create a custom ConnectionProvider to close any connection at "closeConnection(Connection)" (extends from DriverManagerConnectionProvider), and plug it in hibernate using the system proerty "hibernate.connection.provider_class".
Than execute this test:
// set up the sessionFactory, and acquire a session..
Query qry = session.createQuery("select * from TABLE_WITH_2_RECORDS");
ScrollableResult sr = qry.scroll();
sr.next();
// now, before close the ScrollableResult, execute a uniqueResult...
qry = session.createQuery("select FIELD_1 from TABLE_WITH_2_RECORDS order by FIELD_1");
qry.uniqueResult();
sr.next(); // at this time occour a SQLException "Connection Closed: next"
The BUG occours when the uniqueResult() runs, because internaly it returns the connection to the Pool, and the current ConnectionProvider has the logic about CLOSE all connections returned.
--
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, 9 months