Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo] Parent/Child/Child cascade merging error
[Teneo] Parent/Child/Child cascade merging error [message #428238] Mon, 16 March 2009 08:40 Go to next message
koloale is currently offline koloale
Messages: 41
Registered: July 2009
Member
Hello!
I have the following model:

public interface Colocation extends EObject {
/**
* @model containment="true"
* annotation="teneo.jpa appinfo='@OneToMany(fetch=LAZY)'"
*/
EList<Application> getApplication();
}

public interface Application extends EObject {
/**
* @model containment="true"
* extendedMetaData="kind='element' name='serviceGroup'"
* annotation="teneo.jpa appinfo='@OneToMany(fetch=EAGER)'"
*/
EList<ServiceGroup> getServiceGroup();
}

public interface ServiceGroup extends EObject {
/**
* @model
*/
String getName();
}

and the following test case causes exception:
Colocation colo = new Colocation();
coloDao.saveColocation(colo);

sessionFactory.getCurrentSession().save(colo);

Application app = new Application();
colo.getApplication().add(app);

ServiceGroup sg = new ServiceGroup();
app.getServiceGroup().add(sg);

Application merged = (Application)
sessionFactory.getCurrentSession().merge(app);

Exception:
org.hibernate.TransientObjectException: object references an unsaved
transient instance - save the transient instance before flushing:
Application
at
org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUns aved(ForeignKeys.java:219)
at
org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContaine rUserType.getID(EContainerUserType.java:399)
at
org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContaine rUserType.replace(EContainerUserType.java:393)
at
org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContaine rUserType.replace(EContainerUserType.java:152)
at org.hibernate.type.AbstractType.replace(AbstractType.java:15 3)
at org.hibernate.type.TypeFactory.replace(TypeFactory.java:515)
at
org.hibernate.event.def.DefaultMergeEventListener.copyValues (DefaultMergeEventListener.java:377)
at
org.hibernate.event.def.DefaultMergeEventListener.entityIsTr ansient(DefaultMergeEventListener.java:179)
at
org.springframework.orm.hibernate3.support.IdTransferringMer geEventListener.entityIsTransient(IdTransferringMergeEventLi stener.java:58)
at
org.hibernate.event.def.DefaultMergeEventListener.onMerge(De faultMergeEventListener.java:123)
at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:68 7)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:669)
at org.hibernate.engine.CascadingAction$6.cascade(CascadingActi on.java:245)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :216)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
at org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:296)
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 242)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :219)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
at
org.hibernate.event.def.AbstractSaveEventListener.cascadeAft erSave(AbstractSaveEventListener.java:456)
at
org.hibernate.event.def.DefaultMergeEventListener.entityIsTr ansient(DefaultMergeEventListener.java:194)
at
org.springframework.orm.hibernate3.support.IdTransferringMer geEventListener.entityIsTransient(IdTransferringMergeEventLi stener.java:58)
at
org.hibernate.event.def.DefaultMergeEventListener.onMerge(De faultMergeEventListener.java:123)
at
org.hibernate.event.def.DefaultMergeEventListener.onMerge(De faultMergeEventListener.java:53)
at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:67 7)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:661)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:665)
at
my.company.ColoCascadingTest.testFullColoSave(ColoCascadingT est.java:207)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at


It seems that the merge operation doesn't cascade when there are more
than one unsaved nesting children. The update operation works ok, and
when there only one unsaved child also all is ok.

Thank you,
Alexey
Re: [Teneo] Parent/Child/Child cascade merging error [message #428240 is a reply to message #428238] Mon, 16 March 2009 08:58 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5332
Registered: July 2009
Senior Member
Hi Alexey,
You showed the model, is it only part of the total model? Does your model have explicit id efeatures (to hold the
database id)?

Btw, as a workaround you can disable persisting econtainer relations through the following option:
PersistenceOptions.DISABLE_ECONTAINER_MAPPING (set it to false)

Persisting econtainer relations explicitly is only required when you load the children independently from their parent
and need to have correct econtainers set at thay point and in addition want to work with emf resources.

gr. Martin

koloale wrote:
> Hello!
> I have the following model:
>
> public interface Colocation extends EObject {
> /**
> * @model containment="true"
> * annotation="teneo.jpa appinfo='@OneToMany(fetch=LAZY)'"
> */
> EList<Application> getApplication();
> }
>
> public interface Application extends EObject {
> /**
> * @model containment="true"
> * extendedMetaData="kind='element' name='serviceGroup'"
> * annotation="teneo.jpa appinfo='@OneToMany(fetch=EAGER)'"
> */
> EList<ServiceGroup> getServiceGroup();
> }
>
> public interface ServiceGroup extends EObject {
> /**
> * @model
> */
> String getName();
> }
>
> and the following test case causes exception:
> Colocation colo = new Colocation();
> coloDao.saveColocation(colo);
>
> sessionFactory.getCurrentSession().save(colo);
>
> Application app = new Application();
> colo.getApplication().add(app);
>
> ServiceGroup sg = new ServiceGroup();
> app.getServiceGroup().add(sg);
>
> Application merged = (Application)
> sessionFactory.getCurrentSession().merge(app);
>
> Exception:
> org.hibernate.TransientObjectException: object references an unsaved
> transient instance - save the transient instance before flushing:
> Application
> at
> org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUns aved(ForeignKeys.java:219)
>
> at
> org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContaine rUserType.getID(EContainerUserType.java:399)
>
> at
> org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContaine rUserType.replace(EContainerUserType.java:393)
>
> at
> org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContaine rUserType.replace(EContainerUserType.java:152)
>
> at org.hibernate.type.AbstractType.replace(AbstractType.java:15 3)
> at org.hibernate.type.TypeFactory.replace(TypeFactory.java:515)
> at
> org.hibernate.event.def.DefaultMergeEventListener.copyValues (DefaultMergeEventListener.java:377)
>
> at
> org.hibernate.event.def.DefaultMergeEventListener.entityIsTr ansient(DefaultMergeEventListener.java:179)
>
> at
> org.springframework.orm.hibernate3.support.IdTransferringMer geEventListener.entityIsTransient(IdTransferringMergeEventLi stener.java:58)
>
> at
> org.hibernate.event.def.DefaultMergeEventListener.onMerge(De faultMergeEventListener.java:123)
>
> at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:68 7)
> at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:669)
> at
> org.hibernate.engine.CascadingAction$6.cascade(CascadingActi on.java:245)
> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :216)
> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
> at
> org.hibernate.engine.Cascade.cascadeCollectionElements(Casca de.java:296)
> at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java: 242)
> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java :219)
> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:16 9)
> at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
> at
> org.hibernate.event.def.AbstractSaveEventListener.cascadeAft erSave(AbstractSaveEventListener.java:456)
>
> at
> org.hibernate.event.def.DefaultMergeEventListener.entityIsTr ansient(DefaultMergeEventListener.java:194)
>
> at
> org.springframework.orm.hibernate3.support.IdTransferringMer geEventListener.entityIsTransient(IdTransferringMergeEventLi stener.java:58)
>
> at
> org.hibernate.event.def.DefaultMergeEventListener.onMerge(De faultMergeEventListener.java:123)
>
> at
> org.hibernate.event.def.DefaultMergeEventListener.onMerge(De faultMergeEventListener.java:53)
>
> at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:67 7)
> at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:661)
> at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:665)
> at
> my.company.ColoCascadingTest.testFullColoSave(ColoCascadingT est.java:207)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
>
>
> It seems that the merge operation doesn't cascade when there are more
> than one unsaved nesting children. The update operation works ok, and
> when there only one unsaved child also all is ok.
>
> Thank you,
> Alexey


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] Parent/Child/Child cascade merging error [message #428241 is a reply to message #428240] Mon, 16 March 2009 09:07 Go to previous messageGo to next message
koloale is currently offline koloale
Messages: 41
Registered: July 2009
Member
Martin Taal wrote:
> Hi Alexey,
> You showed the model, is it only part of the total model? Does your
> model have explicit id efeatures (to hold the database id)?
>
Yes, I tried to simplify model and omitted maybe important details:
in all entities I have explicit id
/**
* @model id="true"
*/
Long getId();

> Btw, as a workaround you can disable persisting econtainer relations
> through the following option:
> PersistenceOptions.DISABLE_ECONTAINER_MAPPING (set it to false)
>
> Persisting econtainer relations explicitly is only required when you
> load the children independently from their parent and need to have
> correct econtainers set at thay point and in addition want to work with
> emf resources.

Should it work without PersistenceOptions.DISABLE_ECONTAINER_MAPPING or
it is deliberate behavior?
Re: [Teneo] Parent/Child/Child cascade merging error [message #428242 is a reply to message #428241] Mon, 16 March 2009 09:13 Go to previous messageGo to next message
koloale is currently offline koloale
Messages: 41
Registered: July 2009
Member
koloale wrote:
> Yes, I tried to simplify model and omitted maybe important details:
> in all entities I have explicit id
> /**
> * @model id="true"
> */
> Long getId();
For Application and ServiceGroup I have sequence generated id:
/**
* @model id="true"
* annotation="teneo.jpa appinfo='@Id
@GeneratedValue(strategy=SEQUENCE, generator=\"TypedEntityGen\")'"
* @generated
*/
Long getId();
Re: [Teneo] Parent/Child/Child cascade merging error [message #428244 is a reply to message #428241] Mon, 16 March 2009 09:44 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5332
Registered: July 2009
Senior Member
Hi Alexey,
The exception is specifically related to the way Teneo stores econtainer relations. So disabling them should 'solve'
this error. The econtainer relation is stored in a special way because an object can have different types of containers.
So these are not stored in a standard hibernate way:
http://www.elver.org/hibernate/hibernate_relations.html#Stor ing+container+relation

Can you enter a bugzilla for this? I can check if I can enable cascade behavior over econtainer relations also.

Btw, I made a typo to disable econtainer mappings the value "true" should be set in the
PersistenceOptions.DISABLE_ECONTAINER_MAPPING option.

gr. Martin

koloale wrote:
> Martin Taal wrote:
>> Hi Alexey,
>> You showed the model, is it only part of the total model? Does your
>> model have explicit id efeatures (to hold the database id)?
>>
> Yes, I tried to simplify model and omitted maybe important details:
> in all entities I have explicit id
> /**
> * @model id="true"
> */
> Long getId();
>
>> Btw, as a workaround you can disable persisting econtainer relations
>> through the following option:
>> PersistenceOptions.DISABLE_ECONTAINER_MAPPING (set it to false)
>>
>> Persisting econtainer relations explicitly is only required when you
>> load the children independently from their parent and need to have
>> correct econtainers set at thay point and in addition want to work
>> with emf resources.
>
> Should it work without PersistenceOptions.DISABLE_ECONTAINER_MAPPING or
> it is deliberate behavior?


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] Parent/Child/Child cascade merging error [message #830384 is a reply to message #428244] Tue, 27 March 2012 15:02 Go to previous messageGo to next message
Pablo Zamudio is currently offline Pablo Zamudio
Messages: 6
Registered: March 2012
Junior Member
Hi Martin, we are having the same problem with a graph of objects that we need to merge (some of them new objects, other existing dettached objects).
The transient object error seems to happend when the econtainer of a new object is another new object.
Is there any solution or workaround to this problem?
Disabling econtainer persistence is not an option in our case, since we need to query the objects in many of the levels of the graph, and need the econtainers to be setted.

Thanks in advance.
Pablo
Re: [Teneo] Parent/Child/Child cascade merging error [message #830413 is a reply to message #830384] Tue, 27 March 2012 15:32 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5332
Registered: July 2009
Senior Member
Hi Pablo,
First a workaround check :-), are the econtainer associations, explicitly modeled? If so then you can disable econtainer
persistence and use the explicitly modeled association.

gr. Martin

On 03/27/2012 05:02 PM, Pablo Zamudio wrote:
> Hi Martin, we are having the same problem with a graph of objects that we need to merge (some of them new objects, other
> existing dettached objects).
> The transient object error seems to happend when the econtainer of a new object is another new object. Is there any
> solution or workaround to this problem? Disabling econtainer persistence is not an option in our case, since we need to
> query the objects in many of the levels of the graph, and need the econtainers to be setted.
>
> Thanks in advance.
> Pablo
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Parent/Child/Child cascade merging error [message #830513 is a reply to message #830413] Tue, 27 March 2012 18:36 Go to previous messageGo to next message
Pablo Zamudio is currently offline Pablo Zamudio
Messages: 6
Registered: March 2012
Junior Member
Hi Martin, the econtainer associations aren´t modeled explicity, because we have many objects and the cost of mantaining the container associaciones would be quite heavy, so we intend to use the econtainer feature of EMF.

Thanks for the quick response,
Pablo

[Updated on: Tue, 27 March 2012 18:36]

Report message to a moderator

Re: [Teneo] Parent/Child/Child cascade merging error [message #830583 is a reply to message #830513] Tue, 27 March 2012 20:48 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5332
Registered: July 2009
Senior Member
I am afraid that it is quite difficult to get cascading to work over usertypes (used for storing the econtainer
relation). Would it work for you to do the cascade yourselve? You can easily transfer the econtainer associations and
merge/save the parent before the child.

gr. Martin

On 03/27/2012 08:36 PM, Pablo Zamudio wrote:
> Hi Martin, the econtainer associations aren´t modeled explicity, because we have many objects and the cost of mantaining
> the container associaciones would be quite heavy, so we intend to use the econtainer feature of EMF.
>
> Thanks for the quick response,
> Pablo


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Teneo] Parent/Child/Child cascade merging error [message #905028 is a reply to message #830583] Wed, 29 August 2012 15:13 Go to previous messageGo to next message
Pablo Zamudio is currently offline Pablo Zamudio
Messages: 6
Registered: March 2012
Junior Member
Hi Martin, we get into this error once again, with another part of our model. Last time, we do what you suggested, implement the cascade by ourselves, but this time, the graph of objects we are trying to merge with cascades is quite big to resolve the cascading by ourselves. Is there any solution, or tip we can follow to get to solve the cascading of merge over the econtainer usertype?

I leave a new fresh example to clarify the error:

Our model looks like this:
A <>--> B <>--> C (all the relations are containments with multiplicity 0..1)

Our code do this:

public void saveA(A a){
session.save(a);
}

public void saveBandC(A a, B b, C c){
b.setC(c);
a.setB(b);
session.merge(a);
}

In the method saveBandC we get a TransientObjectException, over object B.
The problem seems to be in the merge of object C, when hibernate tries to resolve the value of the econtainer reference (B). At this moment, the method getID of the EContainerUserType is invoked, and it finds out that B is Transient.

The stacktrace of the error is this:

javax.ejb.EJBException: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: B
at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:183)
at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:251)
at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:349)
at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:209)
at org.jboss.ejb3.tx2.aop.CMTTxInterceptorWrapper.invoke(CMTTxInterceptorWrapper.java:52)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:182)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor.invoke(CurrentInvocationContextInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:333)
at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:390)
at sun.reflect.GeneratedMethodAccessor570.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.ejb3.proxy.impl.handler.session.SessionLocalProxyInvocationHandler$LocalContainerInvocation.invokeTarget(SessionLocalProxyInvocationHandler.java:184)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
at org.jboss.ejb3.async.impl.interceptor.AsynchronousClientInterceptor.invoke(AsynchronousClientInterceptor.java:143)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.proxy.impl.handler.session.SessionLocalProxyInvocationHandler$LocalInvokableContextHandler.invoke(SessionLocalProxyInvocationHandler.java:159)
at $Proxy230.invoke(Unknown Source)
at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:185)
at $Proxy381.mergeEObjetoIdentificable(Unknown Source)
at uy.com.gecos.erpm.infrastructure.datamanager.objetosnegocio.tests.querys.TestQuerysObjetosNegocio.crearQueryYSalvarEspecificacionDuenia(TestQuerysObjetosNegocio.java:337)
at uy.com.gecos.erpm.infrastructure.datamanager.objetosnegocio.tests.querys.TestQuerysObjetosNegocio.test_create_query_and_execute_by_id(TestQuerysObjetosNegocio.java:350)
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:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.jboss.arquillian.junit.Arquillian$6$1.invoke(Arquillian.java:270)
at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:60)
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:597)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
at org.jboss.arquillian.container.test.impl.execution.ContainerTestExecuter.execute(ContainerTestExecuter.java:38)
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:597)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89)
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:597)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)
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:597)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)
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:597)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:111)
at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:263)
at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:226)
at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)
at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:185)
at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)
at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at org.junit.runner.JUnitCore.run(JUnitCore.java:136)
at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:65)
at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.executeTest(ServletTestRunner.java:160)
at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.execute(ServletTestRunner.java:126)
at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.doGet(ServletTestRunner.java:90)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181)
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285)
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: B
at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:243)
at org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerUserType.getID(EContainerUserType.java:441)
at org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerUserType.replace(EContainerUserType.java:434)
at org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerUserType.replace(EContainerUserType.java:164)
at org.hibernate.type.AbstractType.replace(AbstractType.java:176)
at org.hibernate.type.TypeHelper.replace(TypeHelper.java:212)
at org.hibernate.event.def.DefaultMergeEventListener.copyValues(DefaultMergeEventListener.java:600)
at org.hibernate.event.def.DefaultMergeEventListener.mergeTransientEntity(DefaultMergeEventListener.java:337)
at org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:303)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:258)
at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:877)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:859)
at org.hibernate.engine.CascadingAction$6.cascade(CascadingAction.java:279)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204)
at org.hibernate.engine.Cascade.cascade(Cascade.java:161)
at org.hibernate.event.def.AbstractSaveEventListener.cascadeBeforeSave(AbstractSaveEventListener.java:450)
at org.hibernate.event.def.DefaultMergeEventListener.mergeTransientEntity(DefaultMergeEventListener.java:336)
at org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:303)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:258)
at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:877)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:859)
at org.hibernate.engine.CascadingAction$6.cascade(CascadingAction.java:279)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204)
at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:425)
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:362)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:338)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204)
at org.hibernate.engine.Cascade.cascade(Cascade.java:161)
at org.hibernate.event.def.DefaultMergeEventListener.cascadeOnMerge(DefaultMergeEventListener.java:630)
at org.hibernate.event.def.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:490)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:255)
at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:877)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:859)
at org.hibernate.engine.CascadingAction$6.cascade(CascadingAction.java:279)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204)
at org.hibernate.engine.Cascade.cascade(Cascade.java:161)
at org.hibernate.event.def.DefaultMergeEventListener.cascadeOnMerge(DefaultMergeEventListener.java:630)
at org.hibernate.event.def.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:490)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:255)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:84)
at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:867)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:851)
at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:855)
at uy.com.gecos.erpm.infrastructure.datamanager.diccionariodatos.metamodelo.persistence.DiccionarioDatosPersistenceManagerBean.mergeEObjetoIdentificable(DiccionarioDatosPersistenceManagerBean.java:147)
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:597)
at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
at org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvocationWrapper.java:72)
at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor$InvocationContext.proceed(InvocationContextInterceptor.java:127)
at org.jboss.weld.integration.ejb.interceptor.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:151)
at org.jboss.weld.integration.ejb.interceptor.Jsr299BindingsInterceptor.doAroundInvoke(Jsr299BindingsInterceptor.java:122)
at sun.reflect.GeneratedMethodAccessor572.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.ejb3.interceptors.aop.EJB3InterceptorInterceptor.invoke(EJB3InterceptorInterceptor.java:80)
at org.jboss.ejb3.interceptors.aop.EJB3InterceptorInterceptor.invoke(EJB3InterceptorInterceptor.java:71)
at org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvocationWrapper.java:62)
at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor$InvocationContext.proceed(InvocationContextInterceptor.java:127)
at org.jboss.weld.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:46)
at org.jboss.weld.integration.deployer.metadata.WeldLifecycleInterceptor.doAroundInvoke(WeldLifecycleInterceptor.java:55)
at sun.reflect.GeneratedMethodAccessor573.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.ejb3.interceptors.aop.EJB3InterceptorInterceptor.invoke(EJB3InterceptorInterceptor.java:80)
at org.jboss.ejb3.interceptors.aop.EJB3InterceptorInterceptor.invoke(EJB3InterceptorInterceptor.java:71)
at org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvocationWrapper.java:62)
at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:76)
at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:62)
at sun.reflect.GeneratedMethodAccessor571.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:74)
at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_19547591.invoke(InvocationContextInterceptor_z_fillMethod_19547591.java)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:90)
at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_19547591.invoke(InvocationContextInterceptor_z_setup_19547591.java)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.async.impl.interceptor.AsynchronousServerInterceptor.invoke(AsynchronousServerInterceptor.java:128)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.core.context.SessionInvocationContextAdapter.proceed(SessionInvocationContextAdapter.java:95)
at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:247)
... 134 more

Thanks in advance.
Pablo
Re: [Teneo] Parent/Child/Child cascade merging error [message #905205 is a reply to message #905028] Wed, 29 August 2012 23:07 Go to previous message
Martin Taal is currently offline Martin Taal
Messages: 5332
Registered: July 2009
Senior Member
Hi Pablo,
Have you tried to travers the container relations and merge/save manually in that order? So something like this:

public void save(EObject eObject) {
if (eObject == null) {
return;
}
save(eObject.eContainer());
// do the real persist of the object
getEntityManager().persist(eObject);
}

gr. Martin

On 08/29/2012 05:13 PM, Pablo Zamudio wrote:
> Hi Martin, we get into this error once again, with another part of our model. Last time, we do what you suggested,
> implement the cascade by ourselves, but this time, the graph of objects we are trying to merge with cascades is quite
> big to resolve the cascading by ourselves. Is there any solution, or tip we can follow to get to solve the cascading of
> merge over the econtainer usertype?
>
> I leave a new fresh example to clarify the error:
>
> Our model looks like this:
> A <>--> B <>--> C (all the relations are containments with multiplicity 0..1)
>
> Our code do this:
>
> public void saveA(A a){
> session.save(a);
> }
>
> public void saveBandC(A a, B b, C c){
> b.setC(c);
> a.setB(b);
> session.merge(a);
> }
>
> In the method saveBandC we get a TransientObjectException, over object B.
> The problem seems to be in the merge of object C, when hibernate tries to resolve the value of the econtainer reference
> (B). At this moment, the method getID of the EContainerUserType is invoked, and it finds out that B is Transient.
>
> The stacktrace of the error is this:
>
> javax.ejb.EJBException: org.hibernate.TransientObjectException: object references an unsaved transient instance - save
> the transient instance before flushing: B
> at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:183)
> at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:251)
> at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:349)
> at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:209)
> at org.jboss.ejb3.tx2.aop.CMTTxInterceptorWrapper.invoke(CMTTxInterceptorWrapper.java:52)
> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
> at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
> at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
> at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:182)
> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
> at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
> at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
> at org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor.invoke(CurrentInvocationContextInterceptor.java:47)
> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
> at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
> at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86)
> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
> at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:333)
> at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:390)
> at sun.reflect.GeneratedMethodAccessor570.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.jboss.ejb3.proxy.impl.handler.session.SessionLocalProxyInvocationHandler$LocalContainerInvocation.invokeTarget(SessionLocalProxyInvocationHandler.java:184)
>
> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
> at org.jboss.ejb3.async.impl.interceptor.AsynchronousClientInterceptor.invoke(AsynchronousClientInterceptor.java:143)
> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
> at
> org.jboss.ejb3.proxy.impl.handler.session.SessionLocalProxyInvocationHandler$LocalInvokableContextHandler.invoke(SessionLocalProxyInvocationHandler.java:159)
>
> at $Proxy230.invoke(Unknown Source)
> at
> org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:185)
>
> at $Proxy381.mergeEObjetoIdentificable(Unknown Source)
> at
> uy.com.gecos.erpm.infrastructure.datamanager.objetosnegocio.tests.querys.TestQuerysObjetosNegocio.crearQueryYSalvarEspecificacionDuenia(TestQuerysObjetosNegocio.java:337)
>
> at
> uy.com.gecos.erpm.infrastructure.datamanager.objetosnegocio.tests.querys.TestQuerysObjetosNegocio.test_create_query_and_execute_by_id(TestQuerysObjetosNegocio.java:350)
>
> 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:597)
> at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> at org.jboss.arquillian.junit.Arquillian$6$1.invoke(Arquillian.java:270)
> at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:60)
> 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:597)
> at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
> at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
> at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
> at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
> at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
> at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
> at org.jboss.arquillian.container.test.impl.execution.ContainerTestExecuter.execute(ContainerTestExecuter.java:38)
> 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:597)
> at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
> at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
> at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
> at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89)
> 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:597)
> at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
> at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
> at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)
> 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:597)
> at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
> at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
> at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)
> 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:597)
> at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
> at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
> at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
> at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:111)
> at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:263)
> at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:226)
> at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)
> at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
> at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:240)
> at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
> at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
> at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:185)
> at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)
> at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
> at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)
> at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
> at org.junit.runner.JUnitCore.run(JUnitCore.java:136)
> at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:65)
> at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.executeTest(ServletTestRunner.java:160)
> at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.execute(ServletTestRunner.java:126)
> at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.doGet(ServletTestRunner.java:90)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
> at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
> at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181)
> at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285)
> at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261)
> at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)
> at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159)
> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> at
> org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)
> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654)
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
> at java.lang.Thread.run(Thread.java:662)
> Caused by: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient
> instance before flushing: B
> at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:243)
> at org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerUserType.getID(EContainerUserType.java:441)
> at org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerUserType.replace(EContainerUserType.java:434)
> at org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerUserType.replace(EContainerUserType.java:164)
> at org.hibernate.type.AbstractType.replace(AbstractType.java:176)
> at org.hibernate.type.TypeHelper.replace(TypeHelper.java:212)
> at org.hibernate.event.def.DefaultMergeEventListener.copyValues(DefaultMergeEventListener.java:600)
> at org.hibernate.event.def.DefaultMergeEventListener.mergeTransientEntity(DefaultMergeEventListener.java:337)
> at org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:303)
> at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:258)
> at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:877)
> at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:859)
> at org.hibernate.engine.CascadingAction$6.cascade(CascadingAction.java:279)
> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392)
> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335)
> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204)
> at org.hibernate.engine.Cascade.cascade(Cascade.java:161)
> at org.hibernate.event.def.AbstractSaveEventListener.cascadeBeforeSave(AbstractSaveEventListener.java:450)
> at org.hibernate.event.def.DefaultMergeEventListener.mergeTransientEntity(DefaultMergeEventListener.java:336)
> at org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:303)
> at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:258)
> at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:877)
> at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:859)
> at org.hibernate.engine.CascadingAction$6.cascade(CascadingAction.java:279)
> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392)
> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335)
> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204)
> at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:425)
> at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:362)
> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:338)
> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204)
> at org.hibernate.engine.Cascade.cascade(Cascade.java:161)
> at org.hibernate.event.def.DefaultMergeEventListener.cascadeOnMerge(DefaultMergeEventListener.java:630)
> at org.hibernate.event.def.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:490)
> at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:255)
> at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:877)
> at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:859)
> at org.hibernate.engine.CascadingAction$6.cascade(CascadingAction.java:279)
> at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392)
> at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335)
> at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204)
> at org.hibernate.engine.Cascade.cascade(Cascade.java:161)
> at org.hibernate.event.def.DefaultMergeEventListener.cascadeOnMerge(DefaultMergeEventListener.java:630)
> at org.hibernate.event.def.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:490)
> at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:255)
> at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:84)
> at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:867)
> at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:851)
> at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:855)
> at
> uy.com.gecos.erpm.infrastructure.datamanager.diccionariodatos.metamodelo.persistence.DiccionarioDatosPersistenceManagerBean.mergeEObjetoIdentificable(DiccionarioDatosPersistenceManagerBean.java:147)
>
> 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:597)
> at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
> at
> org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvocationWrapper.java:72)
> at
> org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor$InvocationContext.proceed(InvocationContextInterceptor.java:127)
>
> at
> org.jboss.weld.integration.ejb.interceptor.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:151)
>
> at
> org.jboss.weld.integration.ejb.interceptor.Jsr299BindingsInterceptor.doAroundInvoke(Jsr299BindingsInterceptor.java:122)
> at sun.reflect.GeneratedMethodAccessor572.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.jboss.ejb3.interceptors.aop.EJB3InterceptorInterceptor.invoke(EJB3InterceptorInterceptor.java:80)
> at org.jboss.ejb3.interceptors.aop.EJB3InterceptorInterceptor.invoke(EJB3InterceptorInterceptor.java:71)
> at
> org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvocationWrapper.java:62)
> at
> org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor$InvocationContext.proceed(InvocationContextInterceptor.java:127)
>
> at org.jboss.weld.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:46)
> at
> org.jboss.weld.integration.deployer.metadata.WeldLifecycleInterceptor.doAroundInvoke(WeldLifecycleInterceptor.java:55)
> at sun.reflect.GeneratedMethodAccessor573.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.jboss.ejb3.interceptors.aop.EJB3InterceptorInterceptor.invoke(EJB3InterceptorInterceptor.java:80)
> at org.jboss.ejb3.interceptors.aop.EJB3InterceptorInterceptor.invoke(EJB3InterceptorInterceptor.java:71)
> at
> org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvocationWrapper.java:62)
> at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:76)
> at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:62)
> at sun.reflect.GeneratedMethodAccessor571.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
> at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:74)
> at
> org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_19547591.invoke(InvocationContextInterceptor_z_fillMethod_19547591.java)
>
> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
> at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:90)
> at
> org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_19547591.invoke(InvocationContextInterceptor_z_setup_19547591.java)
>
> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
> at org.jboss.ejb3.async.impl.interceptor.AsynchronousServerInterceptor.invoke(AsynchronousServerInterceptor.java:128)
> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
> at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
> at
> org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
> at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
> at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
> at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)
> at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
> at org.jboss.ejb3.core.context.SessionInvocationContextAdapter.proceed(SessionInvocationContextAdapter.java:95)
> at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:247)
> ... 134 more
>
> Thanks in advance.
> Pablo


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Previous Topic:Adding classes to generated Package
Next Topic:Distinct ItemProvider for different view
Goto Forum:
  


Current Time: Wed Sep 17 15:43:33 GMT 2014

Powered by FUDForum. Page generated in 0.03571 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software