[Hibernate-JIRA] Created: (EJB-409) EAGER fetched collection + Cascade.PERSIST generates broken behavior on session.update
by Anthony Patricio (JIRA)
EAGER fetched collection + Cascade.PERSIST generates broken behavior on session.update
--------------------------------------------------------------------------------------
Key: EJB-409
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-409
Project: Hibernate Entity Manager
Issue Type: Bug
Affects Versions: 3.2.1
Reporter: Anthony Patricio
Attachments: HBCoreTestCase.zip, HEMTestCase.zip
I didn't really know where to log this extremely weird bug.
Customer 1--* Contact
Bidirectional.
Collection annotated with
@OneToMany(fetch=FetchType.EAGER, mappedBy="customer")
@Cascade({CascadeType.PERSIST})
Step 1: load a Customer (contacts are transparently retrieved) and detach the graph.
Step 2: re attach using session.update
--> session tries to insert into CONTACT table
Weird things:
- works with @OneToMany(fetch=FetchType.LAZY, mappedBy="customer")
- works if CascadeType.PERSIST is removed
- works with 100% plain hibernate (mapping files + session APIs (via session Factory, see test based on hb core template)
- fails with 50% plain hibernate (mapping files + EM APIs to obtain HB session)
- I also tried to use HEM + hb plain mapping files --> this is failing, that's why I raised the issue in HEM project.
I'm attaching 2 testcases: one using HEM test template (failing test) and one using HB Core template (passing test).
This use case is not so exotic and the problem may hide something more critical.
--
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
15 years, 6 months
[Hibernate-JIRA] Created: (HHH-3740) Unable to build EntityManagerFactory when using a non-audited ManyToOne in Audited components
by Erik-Berndt Scheper (JIRA)
Unable to build EntityManagerFactory when using a non-audited ManyToOne in Audited components
----------------------------------------------------------------------------------------------
Key: HHH-3740
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3740
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.4
Reporter: Erik-Berndt Scheper
Since the resolution of HHH-3563, relations in components are now supported.
However, if I try to use a @NotAudited @ManyToOne in an @Embeddable, then Envers does not start up.
Removing @NotAudited to the @ManyToOne @Embeddable and adding @Audited to the related entity resolves the issue.
This does not occur with @NotAudited @ManyToOne in an @Entity.
See attached test case to reproduce this issue.
Stack trace:
javax.persistence.PersistenceException: Unable to build EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677)
at org.hibernate.envers.test.AbstractEntityTest.init(AbstractEntityTest.java:94)
at org.hibernate.envers.test.AbstractEntityTest.init(AbstractEntityTest.java:82)
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.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:398)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:145)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:82)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:167)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:104)
at org.testng.TestRunner.runWorkers(TestRunner.java:712)
at org.testng.TestRunner.privateRun(TestRunner.java:582)
at org.testng.TestRunner.run(TestRunner.java:477)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:324)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:319)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:292)
at org.testng.SuiteRunner.run(SuiteRunner.java:198)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:823)
at org.testng.TestNG.runSuitesLocally(TestNG.java:790)
at org.testng.TestNG.run(TestNG.java:708)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
Caused by: org.hibernate.HibernateException: could not init listeners
at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:205)
at org.hibernate.cfg.Configuration.getInitializedEventListeners(Configuration.java:1352)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
... 24 more
Caused by: org.hibernate.MappingException: An audited relation to a non-audited entity org.hibernate.envers.test.entities.UnversionedStrTestEntity!
at org.hibernate.envers.configuration.metadata.ToOneRelationMetadataGenerator.addToOne(ToOneRelationMetadataGenerator.java:59)
at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.addValue(AuditMetadataGenerator.java:126)
at org.hibernate.envers.configuration.metadata.ComponentMetadataGenerator.addComponent(ComponentMetadataGenerator.java:40)
at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.addValue(AuditMetadataGenerator.java:121)
at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.addProperties(AuditMetadataGenerator.java:161)
at org.hibernate.envers.configuration.metadata.AuditMetadataGenerator.generateSecondPass(AuditMetadataGenerator.java:348)
at org.hibernate.envers.configuration.EntitiesConfigurator.configure(EntitiesConfigurator.java:96)
at org.hibernate.envers.configuration.AuditConfiguration.<init>(AuditConfiguration.java:87)
at org.hibernate.envers.configuration.AuditConfiguration.getFor(AuditConfiguration.java:99)
at org.hibernate.envers.event.AuditEventListener.initialize(AuditEventListener.java:232)
at org.hibernate.event.EventListeners$1.processListener(EventListeners.java:198)
at org.hibernate.event.EventListeners.processListeners(EventListeners.java:181)
at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:194)
... 28 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
15 years, 6 months
[Hibernate-JIRA] Created: (HHH-3509) Sybase - Insert into temp table is in inverted order
by Juraci Paixao Krohling (JIRA)
Sybase - Insert into temp table is in inverted order
-----------------------------------------------------
Key: HHH-3509
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3509
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.2.4.sp1
Environment: Branch_3_2_4_SP1_CP with Sybase 15
Reporter: Juraci Paixao Krohling
As per Sybase documentation [1], this is the supported way to create temp tables based on the results of a select:
select type, "Total_amount" = sum(advance)
into #whatspent
from titles
group by type
But Hibernate [2] is generating:
insert into #Vehicle select vehicle0_.id as id from ( select id, vin, owner, 3 as clazz_ from SUV union select id, vin, owner, 4 as clazz_ from Pickup union select id, vin, owner, 1 as clazz_ from Car union select id, vin, owner, 2 as clazz_ from Truck ) vehicle0_
[1] http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_15...
[2] BulkManipulationTest#testTempTableGenerationIsolation
--
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
15 years, 7 months