myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gerhard Petracek <gerhard.petra...@gmail.com>
Subject Re: [CODI] ThreadScoped / EntityManager in a new Thread
Date Thu, 15 Mar 2012 14:39:50 GMT
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 <struberg@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 <zoigln@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
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message