[Hibernate-JIRA] Created: (HHH-7045) Entity as Map Key and hashCode
by Robert Hollencamp (JIRA)
Entity as Map Key and hashCode
------------------------------
Key: HHH-7045
URL: https://hibernate.onjira.com/browse/HHH-7045
Project: Hibernate ORM
Issue Type: Bug
Components: entity-manager
Affects Versions: 3.6.10, 4.0.1
Environment: Tested 4.0.X, 3.6.X; tested PostgreSQL and Hypersonic
Reporter: Robert Hollencamp
Attachments: jpa-map-work.zip
I have an entity that has a unique field; this is used as the business key. The equals and hashCode methods of the entity class use this field.
When this entity is used as the key for a map, this unique field is not loaded when the map entry is inserted; this causes hashCode to return 0 ("return field != null ? field.hashCode() : 0;") and equals to return true, so no matter how many entries there are only one will be inserted.
If I prime the cache first by loading all of these key entities, it will then work. The attached test case demonstrates this.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 2 months
[Hibernate-JIRA] Created: (HSEARCH-1032) MassIndexer with a update mechanism
by Marcel (JIRA)
MassIndexer with a update mechanism
-----------------------------------
Key: HSEARCH-1032
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-1032
Project: Hibernate Search
Issue Type: New Feature
Components: massindexer
Affects Versions: 4.0.0.Final
Reporter: Marcel
A feature which is already discussed in https://forum.hibernate.org/viewtopic.php?f=9&t=1014063:
It would be great to see an update mechanism instead of an index wipe/rebuild. I got a lot of data (> 17 mio rows) which takes a long time (> 2 hours) to index, which is needed because I don't only manipulate the data with hibernate. While the massindexer is rebuilding the index, the search will miss some of the rows which are not indexed yet, which is not acceptable for me.
Instead of wiping the index and re-adding all rows, update only the changed ones (new, updated, deleted).
The current process is:
1) wipe out the index
2) Add again all entities from the database, loading and processing them with multiple threads
but 2) could be replaced by an update instead of an add operation. But then as a new 3) step, it should look for entries/rows which are deleted from the database and remove them from the index too.
the 3) phase is not top priority for me but would possibly lead other people to use this approach instead of the wipe/reindex procedure (for large datasets). Maybe it can be split, to have an operation only to update the index (without delete) and a second operation to delete already deleted data (on database) from the index.
The whole operation doesn't need to be as fast as the wipe/reindex operation.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 2 months
[Hibernate-JIRA] Created: (HV-425) AbstractMethodError in WebLogic 10.3.4
by Torsti Töllinen (JIRA)
AbstractMethodError in WebLogic 10.3.4
--------------------------------------
Key: HV-425
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-425
Project: Hibernate Validator
Issue Type: Bug
Components: engine
Affects Versions: 4.2.0.Beta1
Environment: WebLogic 10.3.4
Hibernate Validator 4.2.0.Beta1
Spring Framework 3.0.5
Reporter: Torsti Töllinen
Validation fails on WebLogic 10.3.4 with HV 4.2.0.Beta1. WebLogic has been patched with patch QWG8 (Enable JPA 2.0 support on WebLogic Server. CR/BUG 9923849).
With WebLogic version 10.3.3, HV works.
java.lang.AbstractMethodError: org.apache.openjpa.persistence.PersistenceProviderImpl.getProviderUtil()Ljavax/persistence/spi/ProviderUtil;
at javax.persistence.Persistence$PersistenceUtilImpl.isLoaded(Unknown Source)
at org.hibernate.validator.engine.resolver.JPATraversableResolver.isReachable(JPATraversableResolver.java:61)
at org.hibernate.validator.engine.resolver.DefaultTraversableResolver.isReachable(DefaultTraversableResolver.java:131)
at org.hibernate.validator.engine.resolver.SingleThreadCachedTraversableResolver.isReachable(SingleThreadCachedTraversableResolver.java:46)
at org.hibernate.validator.engine.ValidatorImpl.isValidationRequired(ValidatorImpl.java:1126)
at org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:405)
at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForRedefinedDefaultGroup(ValidatorImpl.java:341)
at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:325)
at org.hibernate.validator.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:281)
at org.hibernate.validator.engine.ValidatorImpl.validate(ValidatorImpl.java:129)
at org.springframework.validation.beanvalidation.SpringValidatorAdapter.validate(SpringValidatorAdapter.java:86)
at org.springframework.validation.DataBinder.validate(DataBinder.java:692)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doBind(HandlerMethodInvoker.java:807)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.resolveHandlerArguments(HandlerMethodInvoker.java:359)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:171)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3717)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
--
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, 2 months
[Hibernate-JIRA] Created: (HHH-7044) SQLServer2005Dialect parses GROUP BY clause incorrectly
by George Gastaldi (JIRA)
SQLServer2005Dialect parses GROUP BY clause incorrectly
--------------------------------------------------------
Key: HHH-7044
URL: https://hibernate.onjira.com/browse/HHH-7044
Project: Hibernate ORM
Issue Type: Bug
Reporter: George Gastaldi
The following SQL is parsed incorrectly:
{code:sql}
select distinct this_.ID_SOLICITACAO_ATENDIMENTO as y0_, this_.ID_ATENDIMENTO as y1_, atendiment1_.CD_PROTOCOLO as y2_, hierarquia2_.ID_GRUPO_FINANCEIRO as y3_, grupofinan3_.DS_GRUPO_FINANCEIRO as y4_, this_.NR_SEMAFORO as y5_, this_.ID_ASSUNTO as y6_, assunto5_.DS_ASSUNTO as y7_, assunto5_.ID_ASSUNTO as y8_, this_.ID_STATUS_SOLICITACAO_ATENDIMENTO as y9_, this_.ID_TIPO_PRAZO as y10_, this_.ID_TIPO_ATENDIMENTO as y11_, this_.ID_TIPO_SOLICITACAO as y12_, tiposolici6_.DS_TIPO_SOLICITACAO as y13_, tiposolici6_.ID_TIPO_SOLICITACAO as y14_, this_.ID_CLASSIFICACAO_SOLICITACAO as y15_, classifica8_.DS_CLASSIFICACAO_SOLICITACAO as y16_, this_.ID_PESSOA_ATENDIDA as y17_, pessoaaten9_.NM_PESSOA as y18_, pessoaaten9_.ID_PESSOA as y19_, this_.NR_SEQUENCIA as y20_, this_.DT_CRIACAO as y21_, this_.NR_PRAZO as y22_, tiposolici6_.ID_PRIORIDADE as y23_, status4_.DS_STATUS as y24_, status4_.ID_STATUS as y25_, this_1_.ID_RESPONSAVEL as y26_ from AD_SOLICITACAO_ATENDIMENTO this_ left outer join AD_SOLICITACAO_ATENDIMENTO_RESPONSAVEL this_1_ on this_.ID_SOLICITACAO_ATENDIMENTO=this_1_.ID_SOLICITACAO inner join AD_ASSUNTO assunto5_ on this_.ID_ASSUNTO=assunto5_.ID_ASSUNTO inner join AD_ATENDIMENTO atendiment1_ on this_.ID_ATENDIMENTO=atendiment1_.ID_ATENDIMENTO left outer join AD_ATENDIMENTO_HIERARQUIA_CONTRATO hierarquia2_ on atendiment1_.ID_ATENDIMENTO=hierarquia2_.ID_ATENDIMENTO left outer join AD_GRUPO_FINANCEIRO grupofinan3_ on hierarquia2_.ID_GRUPO_FINANCEIRO=grupofinan3_.ID_GRUPO_FINANCEIRO inner join AD_CLASSIFICACAO_SOLICITACAO classifica8_ on this_.ID_CLASSIFICACAO_SOLICITACAO=classifica8_.ID_CLASSIFICACAO_SOLICITACAO left outer join AD_PESSOA pessoaaten9_ on this_.ID_PESSOA_ATENDIDA=pessoaaten9_.ID_PESSOA left outer join AD_PESSOA_FISICA pessoaaten9_1_ on pessoaaten9_.ID_PESSOA=pessoaaten9_1_.ID_PESSOA left outer join AD_PESSOA_JURIDICA pessoaaten9_2_ on pessoaaten9_.ID_PESSOA=pessoaaten9_2_.ID_PESSOA inner join AD_STATUS_SOLICITACAO_ATENDIMENTO status4_ on this_.ID_STATUS_SOLICITACAO_ATENDIMENTO=status4_.ID_STATUS inner join AD_TIPO_PRAZO tipoprazo7_ on this_.ID_TIPO_PRAZO=tipoprazo7_.ID_TIPO_PRAZO inner join AD_TIPO_SOLICITACAO tiposolici6_ on this_.ID_TIPO_SOLICITACAO=tiposolici6_.ID_TIPO_SOLICITACAO where this_1_.ID_RESPONSAVEL in (?, ?, ?, ?, ?, ?) and status4_.ID_STATUS in (?, ?, ?, ?, ?) order by y21_ desc
{code}
turns into:
{code:sql}
WITH query AS (/* criteria query */ select
this_.id_solicitacao_atendimento as y0_,
this_.id_atendimento as y1_,
atendiment1_.cd_protocolo as y2_,
hierarquia2_.id_grupo_financeiro as y3_,
grupofinan3_.ds_grupo_financeiro as y4_,
this_.nr_semaforo as y5_,
this_.id_assunto as y6_,
assunto5_.ds_assunto as y7_,
assunto5_.id_assunto as y8_,
this_.id_status_solicitacao_atendimento as y9_,
this_.id_tipo_prazo as y10_,
this_.id_tipo_atendimento as y11_,
this_.id_tipo_solicitacao as y12_,
tiposolici6_.ds_tipo_solicitacao as y13_,
tiposolici6_.id_tipo_solicitacao as y14_,
this_.id_classificacao_solicitacao as y15_,
classifica8_.ds_classificacao_solicitacao as y16_,
this_.id_pessoa_atendida as y17_,
pessoaaten9_.nm_pessoa as y18_,
pessoaaten9_.id_pessoa as y19_,
this_.nr_sequencia as y20_,
this_.dt_criacao as y21_,
this_.nr_prazo as y22_,
tiposolici6_.id_prioridade as y23_,
status4_.ds_status as y24_,
status4_.id_status as y25_,
this_1_.id_responsavel as y26_,
ROW_NUMBER() OVER (
order by
y21_ desc) as __hibernate_row_nr__
from
ad_solicitacao_atendimento this_
left outer join
ad_solicitacao_atendimento_responsavel this_1_
on this_.id_solicitacao_atendimento=this_1_.id_solicitacao
inner join
ad_assunto assunto5_
on this_.id_assunto=assunto5_.id_assunto
inner join
ad_atendimento atendiment1_
on this_.id_atendimento=atendiment1_.id_atendimento
left outer join
ad_atendimento_hierarquia_contrato hierarquia2_
on atendiment1_.id_atendimento=hierarquia2_.id_atendimento
left outer join
ad_grupo_financeiro grupofinan3_
on hierarquia2_.id_grupo_financeiro=grupofinan3_.id_grupo_financeiro
inner join
ad_classificacao_solicitacao classifica8_
on this_.id_classificacao_solicitacao=classifica8_.id_classificacao_solicitacao
left outer join
ad_pessoa pessoaaten9_
on this_.id_pessoa_atendida=pessoaaten9_.id_pessoa
left outer join
ad_pessoa_fisica pessoaaten9_1_
on pessoaaten9_.id_pessoa=pessoaaten9_1_.id_pessoa
left outer join
ad_pessoa_juridica pessoaaten9_2_
on pessoaaten9_.id_pessoa=pessoaaten9_2_.id_pessoa
inner join
ad_status_solicitacao_atendimento status4_
on this_.id_status_solicitacao_atendimento=status4_.id_status
inner join
ad_tipo_prazo tipoprazo7_
on this_.id_tipo_prazo=tipoprazo7_.id_tipo_prazo
inner join
ad_tipo_solicitacao tiposolici6_
on this_.id_tipo_solicitacao=tiposolici6_.id_tipo_solicitacao
where
this_1_.id_responsavel in (?, ?, ?, ?, ?, ?)
and status4_.id_status in (?, ?, ?, ?, ?)
group by
this_.id_solicitacao_atendimento,
this_.id_atendimento,
atendiment1_.cd_protocolo,
hierarquia2_.id_grupo_financeiro,
grupofinan3_.ds_grupo_financeiro,
this_.nr_semaforo,
this_.id_assunto,
,
,
this_.id_status_solicitacao_atendimento,
this_.id_tipo_prazo,
this_.id_tipo_atendimento,
this_.id_tipo_solicitacao,
tiposolici6_.ds_tipo_solicitacao,
tiposolici6_.id_tipo_solicitacao,
this_.id_classificacao_solicitacao,
classifica8_.ds_classificacao_solicitacao,
this_.id_pessoa_atendida,
pessoaaten9_.nm_pessoa,
pessoaaten9_.id_pessoa,
this_.nr_sequencia,
this_.dt_criacao,
this_.nr_prazo,
tiposolici6_.id_prioridade,
status4_.ds_status,
status4_.id_status,
this_1_.id_responsavel) SELECT
*
FROM
query
WHERE
__hibernate_row_nr__ >= ?
AND __hibernate_row_nr__ < ?
{code}
Notice the empty "," in the group by clause
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 2 months
[Hibernate-JIRA] Created: (ANN-862) Having to use @ForceDiscriminator kind of breaks JPA compatibility
by Albert Kurucz (JIRA)
Having to use @ForceDiscriminator kind of breaks JPA compatibility
------------------------------------------------------------------
Key: ANN-862
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-862
Project: Hibernate Annotations
Issue Type: Improvement
Affects Versions: 3.4.0.GA, 3.5, JPA 2.0
Environment: JPA
Reporter: Albert Kurucz
According to
http://opensource.atlassian.com/projects/hibernate/browse/ANN-36
@ForceDiscriminator was created as a quick workaround to a problem.
Yes, it solves the problem, but it creates a new problem:
the source code which previously had only JPA annotations, now need to be annotated by a Hibernate annotation,
causing that the the source code is now unable to use just any JPA provider.
Major portability issue!
Everyone who likes Open Source, hates Lock-Ins!
My proposal: change the default to a more sane force=true, so that @ForceDiscriminator will not be needed for general JPA projects.
(And create a @DisableDiscriminator Hibernate annotation, for those who like to brake their code).
If changing default behavior is risky, don't fix this on older versions, but lets change this from 3.5.0-Beta2.
--
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, 2 months
[Hibernate-JIRA] Created: (HHH-3544) Nullability.checkNullability() throws PropertyValueException (not-null property references a null property) for a property that ForeignKeys.Nullifier.nullifyTransientReferences() just nulled
by Jeppe Cramon (JIRA)
Nullability.checkNullability() throws PropertyValueException (not-null property references a null property) for a property that ForeignKeys.Nullifier.nullifyTransientReferences() just nulled
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-3544
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3544
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.1
Environment: Hibernate 3.3.1, Hibernate Annotations 3.4, Hibernate Commons-Annotation 3.3.1, Hibernate EntityManager 3.4, PostgreSQL 8.2.5, Java 5
Reporter: Jeppe Cramon
Attachments: HibernateNullabilityProblem.zip
Nullability.checkNullability throws PropertyValueException (not-null property references a null property) for a property that ForeignKeys.Nullifier.nullifyTransientReferences just nulled.
I've included an Eclipse Java project which can reproduce the problem (didn't include the jars).
The problem requires a pretty big graph to be reproduce able. The file "Domain Model.jpg" displays the Classes that take part in the problem.
The Domain Model is a simplification of the entities from our application.
In the example, ModelTest.java, there's only one active instance entity of each type (from A to H).
With the given test case, when an instance of a is passed to entityManager.persist(..), then the following exception is thrown:
javax.persistence.PersistenceException: org.hibernate.PropertyValueException: not-null property references a null or transient value: dk.hibernatetest.model.C.b
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:226)
at dk.hibernatetest.model.ModelTest.test(ModelTest.java:49)
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.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: org.hibernate.PropertyValueException: not-null property references a null or transient value: dk.hibernatetest.model.C.b
at org.hibernate.engine.Nullability.checkNullability(Nullability.java:95)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:313)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:144)
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49)
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:636)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:628)
at org.hibernate.engine.EJB3CascadingAction$1.cascade(EJB3CascadingAction.java:28)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:291)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:239)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:192)
at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:319)
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:265)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:242)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:192)
at org.hibernate.engine.Cascade.cascade(Cascade.java:153)
at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:479)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:357)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:144)
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49)
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:636)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:628)
at org.hibernate.engine.EJB3CascadingAction$1.cascade(EJB3CascadingAction.java:28)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:291)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:239)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:192)
at org.hibernate.engine.Cascade.cascade(Cascade.java:153)
at org.hibernate.event.def.AbstractSaveEventListener.cascadeBeforeSave(AbstractSaveEventListener.java:454)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:288)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:144)
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49)
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:636)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:628)
at org.hibernate.engine.EJB3CascadingAction$1.cascade(EJB3CascadingAction.java:28)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:291)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:239)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:192)
at org.hibernate.engine.Cascade.cascade(Cascade.java:153)
at org.hibernate.event.def.AbstractSaveEventListener.cascadeBeforeSave(AbstractSaveEventListener.java:454)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:288)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:144)
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49)
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:636)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:628)
at org.hibernate.engine.EJB3CascadingAction$1.cascade(EJB3CascadingAction.java:28)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:291)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:239)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:192)
at org.hibernate.engine.Cascade.cascade(Cascade.java:153)
at org.hibernate.event.def.AbstractSaveEventListener.cascadeBeforeSave(AbstractSaveEventListener.java:454)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:288)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:144)
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49)
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:636)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:628)
at org.hibernate.engine.EJB3CascadingAction$1.cascade(EJB3CascadingAction.java:28)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:291)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:239)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:192)
at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:319)
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:265)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:242)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:192)
at org.hibernate.engine.Cascade.cascade(Cascade.java:153)
at org.hibernate.event.def.AbstractSaveEventListener.cascadeAfterSave(AbstractSaveEventListener.java:479)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:357)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:144)
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49)
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:61)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:645)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:619)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:623)
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:220)
... 21 more
As noted in TestModel.java, if some of the other entities (namely c, g or h) are passed to persist(), then the problem doesn't occur.
I've tried to debug the problem and the only difference I've seen inside ForeignKeys.Nullifier.nullifyTransientReferences() is that, in the cases where an exception is thrown, then the B instance that C.b points to has the state SAVING, whereas when the exception isn't thrown, then it has state MANAGED.
When the B instance has state SAVING, then ForeignKeys.Nullifier.nullifyTransientReferences() nulls then entry in it's value array.
After that, Nullability.checkNullability(), performs a null check, which fails because ForeignKeys.Nullifier.nullifyTransientReferences() just nulled the property in the values array.
Could it be a solution to reverse the order of the ForeignKeys.Nullifier.nullifyTransientReferences() and Nullability.checkNullability() (See AbstractEventListener.performSaveOrReplicate(...))
or does ForeignKeys.Nullifier.nullifyTransientReferences() instead have to take nullability into considerations?
/Jeppe
--
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, 2 months