Hi,

thanks for your both answers!

DeltaSpike sounds great but i would like to wait for an CODI release which
is based on DeltaSpike.

TransactionScoped sounds good. So if i add the @Transactional annotation on
a method, the Transactional context will be shared to all sub methods?
Then i must also add @Trasnaction to my controller action or
actionListener, so that only one EntityManager is created per request?

Isn't it possible to introduce an @ThreadScoped? It would work like an
RequestScoped for requests and can be used via threads, too. Or will a
thread shared between multiple requests (like with ASP.Net)?

Regards,
Thomas

2012/3/15 Gerhard Petracek <gerhard.petra...@gmail.com>

> hi mark,
>
> i agree with you, however, it depends on the implementation (in the
> application) - in some cases @TransactionScoped is enough.
>
> regards,
> gerhard
>
> http://www.irian.at
>
> Your JSF/JavaEE powerhouse -
> JavaEE Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>
>
>
> 2012/3/15 Mark Struberg <strub...@yahoo.de>
>
> > Hi Thomas!
> >
> > Well, we had this problem as well in a Quartz scheduler Extension. And
> > this did lead to the CdiControl approach implemented in OpenWebBeans Test
> > and now moved to DeltaSpike cdise [1]. Please note that this is not yet
> > finished, but will be soon!
> >
> > The functionality is currently in one API but will be split into two
> > interfaces.
> >
> > The first one provides the control to container-independently start and
> > stop the whole container (OWB or Weld) which can be used to boot CDI in a
> > JavaSE environment without having any implementation specific code in
> your
> > project.
> >
> > The second part (I still need to factor this out) will give you the
> > ability to start and stop contexts in respect to the current thread.
> > This will again be container independent and hides all the complexity
> from
> > the user.
> >
> > I hope to be able to finish this work on the weekend (I'm currently
> pretty
> > busy at $$dayjob in a C project)
> >
> > LieGrue,
> > strub
> >
> > [1]
> >
> https://git-wip-us.apache.org/repos/asf?p=incubator-deltaspike.git;a=blob;f=deltaspike/cdise/api/src/main/java/org/apache/deltaspike/cdise/api/CdiContainer.java;h=dc8be0b87f4d350ce0539eec2a43590eeb13e88b;hb=HEAD
> >
> >
> > ----- Original Message -----
> > > From: Thomas Andraschko <zoi...@googlemail.com>
> > > To: MyFaces Discussion <users@myfaces.apache.org>
> > > Cc:
> > > Sent: Thursday, March 15, 2012 3:08 PM
> > > Subject: [CODI] ThreadScoped / EntityManager in a new Thread
> > >
> > > Hi,
> > >
> > > In our webapp, we have an asynchronous XML sender and receiver and we
> > also
> > > need db access with transactions in this thread.
> > > Currently, our EntityManager is procuded in RequestScoped and will not
> > work
> > > in a new thread.
> > >
> > > How can i solve this?
> > > Does any ThreadScoped implementation exists?
> > >
> > > Thanks and best regards,
> > > Thomas
> > >
> >
>

Reply via email to