Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo] Teneo in JEE environment([Teneo] Teneo in JEE environment)
[Teneo] Teneo in JEE environment [message #550696] Wed, 04 August 2010 07:39 Go to next message
Mark Hoffmann is currently offline Mark HoffmannFriend
Messages: 113
Registered: July 2009
Location: Jena
Senior Member
Hello,

I currently try to connect a RCP client to JEE environment (glassfish v.3).
What I want to do is to persist my EMF model instances using JPA (EclipseLink) in an EJB. For this I evaluate Teneo because
its seems to be a promising candidate for this. So I have the following questions:

1. Is ist possible to use Teneo in an non OSGi entvironment?

2. EJB3 makes it possible to give me an EntityManager via DI. Is it possible to give Teneo this EntityManager?

3. The EJB container handles the transactions of the EntityManager for me. In Teneo you have to handle transactions by code. Does this delegates to the EntityManager?

Thank you.

Regards,
Mark
Re: [Teneo] Teneo in JEE environment [message #550717 is a reply to message #550696] Wed, 04 August 2010 07:57 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Mark,
Yes Teneo can be used in a non-osgi environment. The EntityManager needs to be created by a Teneo datastore: the
HBEntityDataStore which implements the EntityManagerFactory interface.

But.., I would check out the Texo project. It is targeted at code generation for the server side with support for most
ecore model constructs:
http://wiki.eclipse.org/Texo
http://wiki.eclipse.org/Texo#Code_generation_topics

It provides:
- code generation with support for most ecore model constructs
- orm generation
- XML/XMI serialization
- easy overrideable templates (xpand)
- etc.

We are currently working on JSON serialization.

The advantage of Texo is that it generates pure pojo code without compiletime/runtime EMF dependencies. This means that
the generated code runs directly/out-of-the-box with EclipseLink and other JPA providers and can more easily be
integrated into other frameworks. See here for more info:
http://wiki.eclipse.org/Texo/Texo_and_EMF#Why_Texo_.28compar ed_to_EMF.29

Fyi, here are some Teneo links (but still I would check out Texo more than Teneo for this usecase...):
http://wiki.eclipse.org/Teneo/Hibernate/Download_and_Install #Install_Teneo_for_use_within_a_Web_Container
http://wiki.eclipse.org/Teneo/Hibernate/Hibernate_Datastore# Spring_configuration_and_the_HbSessionDataStore.2FHbEntityDa taStore

gr. Martin


On 08/04/2010 09:39 AM, Mark Hoffmann wrote:
> Hello,
>
> I currently try to connect a RCP client to JEE environment (glassfish v.3).
> What I want to do is to persist my EMF model instances using JPA
> (EclipseLink) in an EJB. For this I evaluate Teneo because its seems to
> be a promising candidate for this. So I have the following questions:
>
> 1. Is ist possible to use Teneo in an non OSGi entvironment?
>
> 2. EJB3 makes it possible to give me an EntityManager via DI. Is it
> possible to give Teneo this EntityManager?
>
> 3. The EJB container handles the transactions of the EntityManager for
> me. In Teneo you have to handle transactions by code. Does this
> delegates to the EntityManager?
>
> Thank you.
>
> Regards,
> Mark


--

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] Teneo in JEE environment [message #550858 is a reply to message #550717] Wed, 04 August 2010 14:08 Go to previous messageGo to next message
Mark Hoffmann is currently offline Mark HoffmannFriend
Messages: 113
Registered: July 2009
Location: Jena
Senior Member
Hi Martin,

thank you for the Texo link. I gave it a first try, its great seems to be what I need.

I try to get a running example for glassfish.

Regards,
Mark
Re: [Teneo] Teneo in JEE environment [message #766279 is a reply to message #550858] Thu, 15 December 2011 13:49 Go to previous messageGo to next message
fabiangec Missing name is currently offline fabiangec Missing nameFriend
Messages: 10
Registered: December 2011
Junior Member
Hi Martin, my question is similar to that of Mark. I want to use Teneo in Jboss. Texo I was watching, but I prefer to use Teneo. Which would be up to you how best to use?

thanks!

Henry
Re: [Teneo] Teneo in JEE environment [message #766292 is a reply to message #766279] Thu, 15 December 2011 14:05 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
He Henry,
Hmm, not sure what your question is..:
- do you want to know what I would use Texo or Teneo?
or
- what to do to get Teneo to run in a j2ee environment?

Let me know and I will do my best to answer.

gr. Martin

On 12/15/2011 02:49 PM, fabiangec wrote:
> Hi Martin, my question is similar to that of Mark. I want to use Teneo in Jboss. Texo I was watching, but I prefer to
> use Teneo. Which would be up to you how best to use?
>
> thanks!
>
> Henry
>


--

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] Teneo in JEE environment [message #768638 is a reply to message #766292] Tue, 20 December 2011 14:15 Go to previous messageGo to next message
fabiangec Missing name is currently offline fabiangec Missing nameFriend
Messages: 10
Registered: December 2011
Junior Member
Hi Martin, sorry for not clarifying my question correctly. Actually my question is exactly what is the best way to use Teneo in JEE environment, including JBoss. Since we want to offer services using Beans to load / save EObjects from a client. CDO already investigated and found it very hard for what we do.

Thank you!
Re: [Teneo] Teneo in JEE environment [message #768651 is a reply to message #768638] Tue, 20 December 2011 14:45 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Fabian,
Afaics it is not more than placing the correct jars in the WEB-INF/lib directory:
http://wiki.eclipse.org/Teneo/Hibernate/Download_and_Install#Install_Teneo_for_use_within_a_Web_Container

You can download the Teneo jars from this url/index page:
http://download.eclipse.org/modeling/emf/teneo/updates/1.2.0/interim/

(click the hyperlinks). The EMF jars can be found in the install/plugins directory of Eclipse.

And then configure the datastore in a context listener or something else which gets called when starting the app.

Maybe this is usefull:
http://wiki.eclipse.org/Teneo/Hibernate/Hibernate_Datastore#Spring_configuration_and_the_HbSessionDataStore.2FHbEntityDataStore

gr. Martin

On 12/20/2011 03:15 PM, fabiangec wrote:
> Hi Martin, sorry for not clarifying my question correctly. Actually my question is exactly what is the best way to use
> Teneo in JEE environment, including JBoss. Since we want to offer services using Beans to load / save EObjects from a
> client. CDO already investigated and found it very hard for what we do.
>
> Thank you!


--

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] Teneo in JEE environment [message #769628 is a reply to message #768651] Thu, 22 December 2011 12:39 Go to previous messageGo to next message
fabiangec Missing name is currently offline fabiangec Missing nameFriend
Messages: 10
Registered: December 2011
Junior Member
thanks Martin, I did some initial tests datastore initiating a singleton ejb.
The only thing I had to put in the datastore singleton ejb as static and initialized in a static method.
Like this

private static HbDataStore dataStore = init();

private static init(){...}

Excuse my english

Thanks for your help
Re: [Teneo] Teneo in JEE environment [message #769634 is a reply to message #769628] Thu, 22 December 2011 12:48 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Yes the init() will be run when the class gets loaded. Note that with this approach it can be difficult to debug errors.
You will get a CNF or class loading exception. So a different approach can also work:

private static final HbDataStore dataStore;

static {
dataStore = init();
}

private static init() {...}

If this fails then you get a nice stack trace and you can debug easier.

gr. Martin

On 12/22/2011 01:39 PM, fabiangec wrote:
> thanks Martin, I did some initial tests datastore initiating a singleton ejb.
> The only thing I had to put in the datastore singleton ejb as static and initialized in a static method.
> Like this
>
> private static HbDataStore dataStore = init();
>
> private static init(){...}
>
> Excuse my english
>
> Thanks for your help


--

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] Teneo in JEE environment + Merge EMF Objects [message #776905 is a reply to message #769634] Mon, 09 January 2012 13:52 Go to previous messageGo to next message
fabiangec Missing name is currently offline fabiangec Missing nameFriend
Messages: 10
Registered: December 2011
Junior Member
Hi Martin, I'm trying to do a merge of two objects EMF but I get the following error:

11:26:21,482 ERROR [STDERR] org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [EAccion#11]

11:26:21,482 ERROR [STDERR] at org.hibernate.event.def.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:485)

11:26:21,483 ERROR [STDERR] at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:255)

11:26:21,483 ERROR [STDERR] at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:84)

11:26:21,483 ERROR [STDERR] at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:867)

11:26:21,483 ERROR [STDERR] at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:851)

11:26:21,483 ERROR [STDERR] at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:855)

11:26:21,483 ERROR [STDERR] at infraestructure.diccionariodatos.manager.ConfiguracionDiccionarioDatosBean.modificarAccion(ConfiguracionDiccionarioDatosBean.java:428)

11:26:21,483 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

11:26:21,483 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

11:26:21,484 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

11:26:21,484 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)

11:26:21,484 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)

11:26:21,484 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)

11:26:21,484 ERROR [STDERR] at org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvocationWrapper.java:72)

11:26:21,484 ERROR [STDERR] at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:76)

11:26:21,484 ERROR [STDERR] at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:62)

11:26:21,485 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

11:26:21,485 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

11:26:21,485 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

11:26:21,485 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)

11:26:21,485 ERROR [STDERR] at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)

11:26:21,485 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

11:26:21,485 ERROR [STDERR] at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:74)

11:26:21,485 ERROR [STDERR] at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_32011538.invoke(InvocationContextInterceptor_z_fillMethod_32011538.java)

11:26:21,486 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

11:26:21,486 ERROR [STDERR] at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:90)

11:26:21,486 ERROR [STDERR] at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_32011538.invoke(InvocationContextInterceptor_z_setup_32011538.java)

11:26:21,486 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

11:26:21,486 ERROR [STDERR] at org.jboss.ejb3.async.impl.interceptor.AsynchronousServerInterceptor.invoke(AsynchronousServerInterceptor.java:128)

11:26:21,486 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

11:26:21,486 ERROR [STDERR] at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)

11:26:21,487 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

11:26:21,487 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)

11:26:21,487 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

11:26:21,487 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)

11:26:21,487 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

11:26:21,487 ERROR [STDERR] at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)

11:26:21,487 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

11:26:21,487 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)

11:26:21,488 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

11:26:21,488 ERROR [STDERR] at org.jboss.ejb3.core.context.SessionInvocationContextAdapter.proceed(SessionInvocationContextAdapter.java:95)

11:26:21,488 ERROR [STDERR] at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:247)

11:26:21,488 ERROR [STDERR] at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:349)

11:26:21,488 ERROR [STDERR] at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:209)

11:26:21,488 ERROR [STDERR] at org.jboss.ejb3.tx2.aop.CMTTxInterceptorWrapper.invoke(CMTTxInterceptorWrapper.java:52)

11:26:21,488 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

11:26:21,489 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)

11:26:21,489 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

11:26:21,489 ERROR [STDERR] at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)

11:26:21,489 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

11:26:21,489 ERROR [STDERR] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:182)

11:26:21,489 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

11:26:21,489 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)

11:26:21,489 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

11:26:21,490 ERROR [STDERR] at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)

11:26:21,490 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

11:26:21,490 ERROR [STDERR] at org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor.invoke(CurrentInvocationContextInterceptor.java:47)

11:26:21,490 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

11:26:21,490 ERROR [STDERR] at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)

11:26:21,490 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

11:26:21,490 ERROR [STDERR] at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86)

11:26:21,491 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

11:26:21,491 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:392)

11:26:21,491 ERROR [STDERR] at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)

11:26:21,491 ERROR [STDERR] at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)

11:26:21,491 ERROR [STDERR] at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)

11:26:21,491 ERROR [STDERR] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:967)

11:26:21,491 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791)

11:26:21,491 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744)

11:26:21,492 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)

11:26:21,492 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)

You make the adjustments mentioned in the following link

Teneo/Hibernate/EMF_Hibernate_Integration_Details#Client-Server_scenario:_requires_explicitly_modelled_id_and_version_properties

In my model I have is an interface which has two EAttributes, one is the id and the other is the version. For the version attribute I put the @ Version. All of my model EClass inherit from this interface.

The properties have the following values:
PropiedadesTeneo Properties = new Properties ();
propiedadesTeneo.setProperty (Environment.DATASOURCE, "java: myDS");
propiedadesTeneo.setProperty (Environment.SHOW_SQL, "true");
propiedadesTeneo.setProperty (Environment.HBM2DDL_AUTO, "update");
propiedadesTeneo.setProperty (Environment.FORMAT_SQL, "true");
propiedadesTeneo.setProperty (PersistenceOptions.CASCADE_POLICY_ON_NON_CONTAINMENT,"REFRESH, PERSIST, MERGE");
propiedadesTeneo.setProperty (PersistenceOptions.ALWAYS_VERSION, "false");
propiedadesTeneo.setProperty (PersistenceOptions.DEFAULT_ID_FEATURE_NAME, "id");
propiedadesTeneo.setProperty (PersistenceOptions.INHERITANCE_MAPPING, "join");

The function that performs the merge from the client receives a new object with the ID exactly as it is already persisted and lines of code where failure is simply this.

PersistenceMngm.getHbDataStoreSessionFactory Session session = (). GetCurrentSession ();

EAccion item2 = (EAccion) session.get (EAccion.class.getSimpleName (), nuevaAccion.getId ());

EAccion accionMergeada = (EAccion) Session.merge (nuevaAccion);

Could you help me with this?
Thank you very much

[Updated on: Mon, 09 January 2012 16:30]

Report message to a moderator

Re: [Teneo] Teneo in JEE environment + Merge EMF Objects [message #777293 is a reply to message #776905] Tue, 10 January 2012 08:34 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi,
My feel is that the PersistenceOptions.DEFAULT_ID_FEATURE_NAME option is not working as indicated. Can you try with an
@Id annotation?

gr. Martin

On 01/09/2012 02:52 PM, fabiangec Mising name wrote:
> Hi Martin, I'm trying to do a merge of two objects EMF but I get the following error:
>
> 11:26:21,482 ERROR [STDERR] org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction
> (or unsaved-value mapping was incorrect): [EAccion#11]
>
> 11:26:21,482 ERROR [STDERR] at
> org.hibernate.event.def.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:485)
>
> 11:26:21,483 ERROR [STDERR] at
> org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:255)
>
> 11:26:21,483 ERROR [STDERR] at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:84)
>
> 11:26:21,483 ERROR [STDERR] at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:867)
>
> 11:26:21,483 ERROR [STDERR] at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:851)
>
> 11:26:21,483 ERROR [STDERR] at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:855)
>
> 11:26:21,483 ERROR [STDERR] at
> uy.com.gecos.erpm.infraestructure.diccionariodatos.manager.ConfiguracionDiccionarioDatosBean.modificarAccion(ConfiguracionDiccionarioDatosBean.java:428)
>
>
> 11:26:21,483 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> 11:26:21,483 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> 11:26:21,484 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> 11:26:21,484 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
>
> 11:26:21,484 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
>
> 11:26:21,484 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
>
> 11:26:21,484 ERROR [STDERR] at
> org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvocationWrapper.java:72)
>
> 11:26:21,484 ERROR [STDERR] at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:76)
>
> 11:26:21,484 ERROR [STDERR] at
> org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:62)
>
> 11:26:21,485 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> 11:26:21,485 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> 11:26:21,485 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> 11:26:21,485 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
>
> 11:26:21,485 ERROR [STDERR] at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
>
> 11:26:21,485 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 11:26:21,485 ERROR [STDERR] at
> org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:74)
>
> 11:26:21,485 ERROR [STDERR] at
> org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_32011538.invoke(InvocationContextInterceptor_z_fillMethod_32011538.java)
>
>
> 11:26:21,486 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 11:26:21,486 ERROR [STDERR] at
> org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:90)
>
> 11:26:21,486 ERROR [STDERR] at
> org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_32011538.invoke(InvocationContextInterceptor_z_setup_32011538.java)
>
>
> 11:26:21,486 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 11:26:21,486 ERROR [STDERR] at
> org.jboss.ejb3.async.impl.interceptor.AsynchronousServerInterceptor.invoke(AsynchronousServerInterceptor.java:128)
>
> 11:26:21,486 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 11:26:21,486 ERROR [STDERR] at
> org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
>
> 11:26:21,487 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 11:26:21,487 ERROR [STDERR] at
> org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
>
> 11:26:21,487 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 11:26:21,487 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
>
> 11:26:21,487 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 11:26:21,487 ERROR [STDERR] at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
>
> 11:26:21,487 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 11:26:21,487 ERROR [STDERR] at
> org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)
>
> 11:26:21,488 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 11:26:21,488 ERROR [STDERR] at
> org.jboss.ejb3.core.context.SessionInvocationContextAdapter.proceed(SessionInvocationContextAdapter.java:95)
>
> 11:26:21,488 ERROR [STDERR] at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:247)
>
> 11:26:21,488 ERROR [STDERR] at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:349)
>
> 11:26:21,488 ERROR [STDERR] at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:209)
>
> 11:26:21,488 ERROR [STDERR] at org.jboss.ejb3.tx2.aop.CMTTxInterceptorWrapper.invoke(CMTTxInterceptorWrapper.java:52)
>
> 11:26:21,488 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 11:26:21,489 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
>
> 11:26:21,489 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 11:26:21,489 ERROR [STDERR] at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
>
> 11:26:21,489 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 11:26:21,489 ERROR [STDERR] at
> org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:182)
>
> 11:26:21,489 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 11:26:21,489 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
>
> 11:26:21,489 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 11:26:21,490 ERROR [STDERR] at
> org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
>
> 11:26:21,490 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 11:26:21,490 ERROR [STDERR] at
> org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor.invoke(CurrentInvocationContextInterceptor.java:47)
>
> 11:26:21,490 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 11:26:21,490 ERROR [STDERR] at
> org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
>
> 11:26:21,490 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 11:26:21,490 ERROR [STDERR] at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86)
>
> 11:26:21,491 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 11:26:21,491 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:392)
>
> 11:26:21,491 ERROR [STDERR] at
> org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)
>
> 11:26:21,491 ERROR [STDERR] at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
>
> 11:26:21,491 ERROR [STDERR] at
> org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
>
> 11:26:21,491 ERROR [STDERR] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:967)
>
> 11:26:21,491 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791)
>
> 11:26:21,491 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744)
>
> 11:26:21,492 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)
>
> 11:26:21,492 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)
>
> You make the adjustments mentioned in the following link
>
> Teneo/Hibernate/EMF_Hibernate_Integration_Details#Client-Server_scenario:_requires_explicitly_modelled_id_and_version_properties
>
>
> In my model I have is an interface which has two EAttributes, one is the id and the other is the version. For the
> version attribute I put the @ Version. All of my model EClass inherit from this interface.
>
> The properties have the following values:
> PropiedadesTeneo Properties = new Properties ();
> propiedadesTeneo.setProperty (Environment.DATASOURCE, "java: myDS");
> propiedadesTeneo.setProperty (Environment.SHOW_SQL, "true");
> propiedadesTeneo.setProperty (Environment.HBM2DDL_AUTO, "update");
> propiedadesTeneo.setProperty (Environment.FORMAT_SQL, "true");
> propiedadesTeneo.setProperty (PersistenceOptions.CASCADE_POLICY_ON_NON_CONTAINMENT,"REFRESH, PERSIST, MERGE");
> propiedadesTeneo.setProperty (PersistenceOptions.ALWAYS_VERSION, "false");
> propiedadesTeneo.setProperty (PersistenceOptions.DEFAULT_ID_FEATURE_NAME, "id");
> propiedadesTeneo.setProperty (PersistenceOptions.INHERITANCE_MAPPING, "join");
>
> The function that performs the merge from the client receives a new object with the ID exactly as it is already
> persisted and lines of code where failure is simply this.
>
> PersistenceMngm.getHbDataStoreSessionFactory Session session = (). GetCurrentSession ();
> EAccion item2 = (EAccion) session.get (EAccion.class.getSimpleName (), nuevaAccion.getId ());
> EAccion accionMergeada = (EAccion) Session.merge (nuevaAccion);
>
> Could you help me with this?
> Thank you very much
>


--

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] Teneo in JEE environment + Merge EMF Objects [message #777447 is a reply to message #777293] Tue, 10 January 2012 14:35 Go to previous messageGo to next message
fabiangec Missing name is currently offline fabiangec Missing nameFriend
Messages: 10
Registered: December 2011
Junior Member
Hi Martin! Thanks for your quick response.

This implies that the values ​​for the id field it manually does not have to give?
I ask because I used to use the hibernate_sequence

Thanks again!
Fabian
Re: [Teneo] Teneo in JEE environment + Merge EMF Objects [message #777486 is a reply to message #777447] Tue, 10 January 2012 15:35 Go to previous messageGo to next message
fabiangec Missing name is currently offline fabiangec Missing nameFriend
Messages: 10
Registered: December 2011
Junior Member
I tried it but just keep getting the same error. It will be a problem with respect to how the current session asking?
I have an Singleton class with de static datastore and a function that get session factory

public SessionFactory getHbDataStoreSessionFactory() {
if (dataStore != null){
return dataStore.getSessionFactory();
} else{
return null;
}
}

then in other EJB I call this function to get de current session

@EJB
private DiccionarioPersistenceManager persistenceMngm;

....

Session session = persistenceMngm.getSessionFactory().getCurrentSession();

EAccion item2 = (EAccion) session.get(EAccion.class.getSimpleName(), nuevaAccion.getId());
EAccion accionMerge = (EAccion) session.merge(nuevaAccion);



13:25:37,104 ERROR [STDERR] org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [EAccion#9]

13:25:37,104 ERROR [STDERR] at org.hibernate.event.def.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:485)

13:25:37,104 ERROR [STDERR] at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:255)

13:25:37,104 ERROR [STDERR] at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:84)

13:25:37,104 ERROR [STDERR] at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:867)

13:25:37,104 ERROR [STDERR] at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:851)

13:25:37,104 ERROR [STDERR] at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:855)

13:25:37,105 ERROR [STDERR] at infraestructure.diccionariodatos.manager.ConfiguracionDiccionarioDatosBean.modificarAccion(ConfiguracionDiccionarioDatosBean.java:441)

13:25:37,105 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

13:25:37,105 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

13:25:37,105 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

13:25:37,105 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)

13:25:37,105 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)

13:25:37,105 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)

13:25:37,105 ERROR [STDERR] at org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvocationWrapper.java:72)

13:25:37,105 ERROR [STDERR] at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:76)

13:25:37,105 ERROR [STDERR] at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:62)

13:25:37,105 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

13:25:37,105 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

13:25:37,105 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

13:25:37,105 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)

13:25:37,105 ERROR [STDERR] at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)

13:25:37,105 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

13:25:37,105 ERROR [STDERR] at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:74)

13:25:37,105 ERROR [STDERR] at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_20298077.invoke(InvocationContextInterceptor_z_fillMethod_20298077.java)

13:25:37,105 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

13:25:37,106 ERROR [STDERR] at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:90)

13:25:37,106 ERROR [STDERR] at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_20298077.invoke(InvocationContextInterceptor_z_setup_20298077.java)

13:25:37,106 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

13:25:37,106 ERROR [STDERR] at org.jboss.ejb3.async.impl.interceptor.AsynchronousServerInterceptor.invoke(AsynchronousServerInterceptor.java:128)

13:25:37,106 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

13:25:37,106 ERROR [STDERR] at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)

13:25:37,106 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

13:25:37,106 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)

13:25:37,106 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

13:25:37,106 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)

13:25:37,106 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

13:25:37,106 ERROR [STDERR] at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)

13:25:37,106 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

13:25:37,106 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)

13:25:37,106 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

13:25:37,106 ERROR [STDERR] at org.jboss.ejb3.core.context.SessionInvocationContextAdapter.proceed(SessionInvocationContextAdapter.java:95)

13:25:37,106 ERROR [STDERR] at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:247)

13:25:37,106 ERROR [STDERR] at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:349)

13:25:37,106 ERROR [STDERR] at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:209)

13:25:37,107 ERROR [STDERR] at org.jboss.ejb3.tx2.aop.CMTTxInterceptorWrapper.invoke(CMTTxInterceptorWrapper.java:52)

13:25:37,107 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

13:25:37,107 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)

13:25:37,107 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

13:25:37,107 ERROR [STDERR] at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)

13:25:37,107 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

13:25:37,107 ERROR [STDERR] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:182)

13:25:37,107 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

13:25:37,107 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)

13:25:37,107 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

13:25:37,107 ERROR [STDERR] at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)

13:25:37,107 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

13:25:37,107 ERROR [STDERR] at org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor.invoke(CurrentInvocationContextInterceptor.java:47)

13:25:37,107 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

13:25:37,107 ERROR [STDERR] at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)

13:25:37,107 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

13:25:37,108 ERROR [STDERR] at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86)

13:25:37,108 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

13:25:37,108 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:392)

13:25:37,108 ERROR [STDERR] at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)

13:25:37,108 ERROR [STDERR] at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)

13:25:37,108 ERROR [STDERR] at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)

13:25:37,108 ERROR [STDERR] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:967)

13:25:37,108 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791)

13:25:37,108 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744)

13:25:37,108 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)

13:25:37,108 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)

13:26:38,785 DEBUG [com.arjuna.ats.arjuna] PeriodicRecovery: background thread Status <== SCANNING
13:26:38,785 DEBUG [com.arjuna.ats.arjuna] PeriodicRecovery: background thread scanning
13:26:38,785 DEBUG [com.arjuna.ats.arjuna] Periodic recovery first pass at mar, 10 ene 2012 13:26:38
13:26:38,785 DEBUG [com.arjuna.ats.arjuna] AtomicActionRecoveryModule first pass
13:26:38,786 DEBUG [com.arjuna.ats.arjuna] processing /StateManager/BasicAction/TwoPhaseCoordinator/AtomicAction transactions
13:26:38,786 DEBUG [com.arjuna.ats.arjuna]
13:26:38,786 DEBUG [com.arjuna.ats.txoj] TORecoveryModule - first pass
13:26:38,801 DEBUG [com.arjuna.ats.arjuna]
13:26:38,801 DEBUG [com.arjuna.ats.jta] Local XARecoveryModule - first pass
13:26:38,802 DEBUG [com.arjuna.ats.arjuna]
13:26:48,802 DEBUG [com.arjuna.ats.arjuna] Periodic recovery second pass at mar, 10 ene 2012 13:26:48
13:26:48,802 DEBUG [com.arjuna.ats.arjuna] AtomicActionRecoveryModule second pass
13:26:48,802 DEBUG [com.arjuna.ats.arjuna]
13:26:48,802 DEBUG [com.arjuna.ats.txoj] TORecoveryModule - second pass
13:26:48,802 DEBUG [com.arjuna.ats.arjuna]
13:26:48,802 DEBUG [com.arjuna.ats.jta] Local XARecoveryModule - second pass
13:26:48,803 DEBUG [com.arjuna.ats.jta] Local XARecoveryModule.transactionInitiatedRecovery completed
13:26:48,803 DEBUG [com.arjuna.ats.jta] Local XARecoveryModule.resourceInitiatedRecovery completed
13:26:48,803 DEBUG [com.arjuna.ats.arjuna]
13:26:48,803 DEBUG [com.arjuna.ats.arjuna] PeriodicRecovery: background thread Status <== INACTIVE
13:26:48,803 DEBUG [com.arjuna.ats.arjuna] PeriodicRecovery: background thread backing off


Thanks for your help!!

[Updated on: Tue, 10 January 2012 15:36]

Report message to a moderator

Re: [Teneo] Teneo in JEE environment + Merge EMF Objects [message #777629 is a reply to message #777486] Tue, 10 January 2012 20:52 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Does your version have a value also and is it the same as the version number in the database? Hibernate will do a query
with a where statement on the version also.

gr. Martin

On 01/10/2012 04:35 PM, fabiangec Mising name wrote:
> I tried it but just keep getting the same error. It will be a problem with respect to how the current session asking?
> I have an Singleton class with de static datastore and a function that get session factory
>
> public SessionFactory getHbDataStoreSessionFactory() {
> if (dataStore != null){
> return dataStore.getSessionFactory();
> } else{
> return null;
> }
> }
>
> then in other EJB I call this function to get de current session
>
> @EJB private DiccionarioPersistenceManager persistenceMngm;
>
> ....
>
> Session session = persistenceMngm.getSessionFactory().getCurrentSession();
>
> EAccion item2 = (EAccion) session.get(EAccion.class.getSimpleName(), nuevaAccion.getId());
> EAccion accionMerge = (EAccion) session.merge(nuevaAccion);
>
>
>
> 13:25:37,104 ERROR [STDERR] org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction
> (or unsaved-value mapping was incorrect): [EAccion#9]
>
> 13:25:37,104 ERROR [STDERR] at
> org.hibernate.event.def.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:485)
>
> 13:25:37,104 ERROR [STDERR] at
> org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:255)
>
> 13:25:37,104 ERROR [STDERR] at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:84)
>
> 13:25:37,104 ERROR [STDERR] at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:867)
>
> 13:25:37,104 ERROR [STDERR] at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:851)
>
> 13:25:37,104 ERROR [STDERR] at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:855)
>
> 13:25:37,105 ERROR [STDERR] at
> uy.com.gecos.erpm.infraestructure.diccionariodatos.manager.ConfiguracionDiccionarioDatosBean.modificarAccion(ConfiguracionDiccionarioDatosBean.java:441)
>
>
> 13:25:37,105 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> 13:25:37,105 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> 13:25:37,105 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> 13:25:37,105 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
>
> 13:25:37,105 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
>
> 13:25:37,105 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
>
> 13:25:37,105 ERROR [STDERR] at
> org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvocationWrapper.java:72)
>
> 13:25:37,105 ERROR [STDERR] at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:76)
>
> 13:25:37,105 ERROR [STDERR] at
> org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:62)
>
> 13:25:37,105 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> 13:25:37,105 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> 13:25:37,105 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> 13:25:37,105 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
>
> 13:25:37,105 ERROR [STDERR] at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
>
> 13:25:37,105 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 13:25:37,105 ERROR [STDERR] at
> org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:74)
>
> 13:25:37,105 ERROR [STDERR] at
> org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_20298077.invoke(InvocationContextInterceptor_z_fillMethod_20298077.java)
>
>
> 13:25:37,105 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 13:25:37,106 ERROR [STDERR] at
> org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:90)
>
> 13:25:37,106 ERROR [STDERR] at
> org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_20298077.invoke(InvocationContextInterceptor_z_setup_20298077.java)
>
>
> 13:25:37,106 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 13:25:37,106 ERROR [STDERR] at
> org.jboss.ejb3.async.impl.interceptor.AsynchronousServerInterceptor.invoke(AsynchronousServerInterceptor.java:128)
>
> 13:25:37,106 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 13:25:37,106 ERROR [STDERR] at
> org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
>
> 13:25:37,106 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 13:25:37,106 ERROR [STDERR] at
> org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
>
> 13:25:37,106 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 13:25:37,106 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
>
> 13:25:37,106 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 13:25:37,106 ERROR [STDERR] at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
>
> 13:25:37,106 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 13:25:37,106 ERROR [STDERR] at
> org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)
>
> 13:25:37,106 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 13:25:37,106 ERROR [STDERR] at
> org.jboss.ejb3.core.context.SessionInvocationContextAdapter.proceed(SessionInvocationContextAdapter.java:95)
>
> 13:25:37,106 ERROR [STDERR] at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:247)
>
> 13:25:37,106 ERROR [STDERR] at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:349)
>
> 13:25:37,106 ERROR [STDERR] at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:209)
>
> 13:25:37,107 ERROR [STDERR] at org.jboss.ejb3.tx2.aop.CMTTxInterceptorWrapper.invoke(CMTTxInterceptorWrapper.java:52)
>
> 13:25:37,107 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 13:25:37,107 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
>
> 13:25:37,107 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 13:25:37,107 ERROR [STDERR] at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
>
> 13:25:37,107 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 13:25:37,107 ERROR [STDERR] at
> org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:182)
>
> 13:25:37,107 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 13:25:37,107 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
>
> 13:25:37,107 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 13:25:37,107 ERROR [STDERR] at
> org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
>
> 13:25:37,107 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 13:25:37,107 ERROR [STDERR] at
> org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor.invoke(CurrentInvocationContextInterceptor.java:47)
>
> 13:25:37,107 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 13:25:37,107 ERROR [STDERR] at
> org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
>
> 13:25:37,107 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 13:25:37,108 ERROR [STDERR] at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86)
>
> 13:25:37,108 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
>
> 13:25:37,108 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:392)
>
> 13:25:37,108 ERROR [STDERR] at
> org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)
>
> 13:25:37,108 ERROR [STDERR] at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
>
> 13:25:37,108 ERROR [STDERR] at
> org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
>
> 13:25:37,108 ERROR [STDERR] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:967)
>
> 13:25:37,108 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791)
>
> 13:25:37,108 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744)
>
> 13:25:37,108 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)
>
> 13:25:37,108 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)
>
> 13:26:38,785 DEBUG [com.arjuna.ats.arjuna] PeriodicRecovery: background thread Status <== SCANNING
> 13:26:38,785 DEBUG [com.arjuna.ats.arjuna] PeriodicRecovery: background thread scanning
> 13:26:38,785 DEBUG [com.arjuna.ats.arjuna] Periodic recovery first pass at mar, 10 ene 2012 13:26:38
> 13:26:38,785 DEBUG [com.arjuna.ats.arjuna] AtomicActionRecoveryModule first pass
> 13:26:38,786 DEBUG [com.arjuna.ats.arjuna] processing /StateManager/BasicAction/TwoPhaseCoordinator/AtomicAction
> transactions
> 13:26:38,786 DEBUG [com.arjuna.ats.arjuna] 13:26:38,786 DEBUG [com.arjuna.ats.txoj] TORecoveryModule - first pass
> 13:26:38,801 DEBUG [com.arjuna.ats.arjuna] 13:26:38,801 DEBUG [com.arjuna.ats.jta] Local XARecoveryModule - first pass
> 13:26:38,802 DEBUG [com.arjuna.ats.arjuna] 13:26:48,802 DEBUG [com.arjuna.ats.arjuna] Periodic recovery second pass at
> mar, 10 ene 2012 13:26:48
> 13:26:48,802 DEBUG [com.arjuna.ats.arjuna] AtomicActionRecoveryModule second pass
> 13:26:48,802 DEBUG [com.arjuna.ats.arjuna] 13:26:48,802 DEBUG [com.arjuna.ats.txoj] TORecoveryModule - second pass
> 13:26:48,802 DEBUG [com.arjuna.ats.arjuna] 13:26:48,802 DEBUG [com.arjuna.ats.jta] Local XARecoveryModule - second pass
> 13:26:48,803 DEBUG [com.arjuna.ats.jta] Local XARecoveryModule.transactionInitiatedRecovery completed
> 13:26:48,803 DEBUG [com.arjuna.ats.jta] Local XARecoveryModule.resourceInitiatedRecovery completed
> 13:26:48,803 DEBUG [com.arjuna.ats.arjuna] 13:26:48,803 DEBUG [com.arjuna.ats.arjuna] PeriodicRecovery: background
> thread Status <== INACTIVE
> 13:26:48,803 DEBUG [com.arjuna.ats.arjuna] PeriodicRecovery: background thread backing off
>
>
> Thanks for your help!!


--

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] Teneo in JEE environment + Merge EMF Objects [message #778058 is a reply to message #777629] Wed, 11 January 2012 11:09 Go to previous message
fabiangec Missing name is currently offline fabiangec Missing nameFriend
Messages: 10
Registered: December 2011
Junior Member
You're right. Excuse me for the hibernate beginner question.
Thank you very much for your patience too.
Fabian
Previous Topic:[CDO] SAXParseException opening a view in CDO
Next Topic:Best-practices/patterns with extensible models
Goto Forum:
  


Current Time: Fri Apr 26 12:44:34 GMT 2024

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

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

Back to the top