You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@deltaspike.apache.org by Dave Oxley <da...@oxley.email> on 2017/01/01 02:02:43 UTC

Transactional events

Hi,

I'm writing a simple app with Deltaspike JPA, Hibernate and Weld targeting
Tomcat 8 which is working well. I need to setup an Event that is
@Observes(during = TransactionPhase.AFTER_SUCCESS) but the event is being
received when it's fired rather than when the transaction commits. Is there
a way to set this up without going with a full J2EE container?

Cheers,
Dave.

Re: Transactional events

Posted by "John D. Ament" <jo...@apache.org>.
Hi,

So the behavior is dependent on a JTA implemetatnion.  Did you provide a
JTA implementation and perform integration?

John

On Sat, Dec 31, 2016 at 9:32 PM Dave Oxley <da...@oxleyws.com.au> wrote:

> I'm using Weld 2.4.1.Final.
>
>
> On 1 January 2017 at 13:29, John D. Ament <jo...@apache.org> wrote:
>
> > What version of weld are you using?
> >
> > On Dec 31, 2016 21:02, "Dave Oxley" <da...@oxley.email> wrote:
> >
> > > Hi,
> > >
> > > I'm writing a simple app with Deltaspike JPA, Hibernate and Weld
> > targeting
> > > Tomcat 8 which is working well. I need to setup an Event that is
> > > @Observes(during = TransactionPhase.AFTER_SUCCESS) but the event is
> > being
> > > received when it's fired rather than when the transaction commits. Is
> > there
> > > a way to set this up without going with a full J2EE container?
> > >
> > > Cheers,
> > > Dave.
> > >
> >
>

Re: Transactional events

Posted by Matej Novotny <ma...@redhat.com>.
Hello,

what you most likely need is described in Weld docs[1].
Basically, you want to make use of our SPI (TransactionalServices) through which you register an implementation of javax.transaction.Synchronization.

Matej
____________________________________________________________-
[1] http://docs.jboss.org/weld/reference/latest/en-US/html/ri-spi.html#_transaction_services


----- Original Message -----
> From: "Dave Oxley" <da...@oxleyws.com.au>
> To: users@deltaspike.apache.org
> Sent: Sunday, January 1, 2017 3:32:49 AM
> Subject: Re: Transactional events
> 
> I'm using Weld 2.4.1.Final.
> 
> 
> On 1 January 2017 at 13:29, John D. Ament <jo...@apache.org> wrote:
> 
> > What version of weld are you using?
> >
> > On Dec 31, 2016 21:02, "Dave Oxley" <da...@oxley.email> wrote:
> >
> > > Hi,
> > >
> > > I'm writing a simple app with Deltaspike JPA, Hibernate and Weld
> > targeting
> > > Tomcat 8 which is working well. I need to setup an Event that is
> > > @Observes(during = TransactionPhase.AFTER_SUCCESS) but the event is
> > being
> > > received when it's fired rather than when the transaction commits. Is
> > there
> > > a way to set this up without going with a full J2EE container?
> > >
> > > Cheers,
> > > Dave.
> > >
> >
> 

Re: Transactional events

Posted by Dave Oxley <da...@oxleyws.com.au>.
I'm using Weld 2.4.1.Final.


On 1 January 2017 at 13:29, John D. Ament <jo...@apache.org> wrote:

> What version of weld are you using?
>
> On Dec 31, 2016 21:02, "Dave Oxley" <da...@oxley.email> wrote:
>
> > Hi,
> >
> > I'm writing a simple app with Deltaspike JPA, Hibernate and Weld
> targeting
> > Tomcat 8 which is working well. I need to setup an Event that is
> > @Observes(during = TransactionPhase.AFTER_SUCCESS) but the event is
> being
> > received when it's fired rather than when the transaction commits. Is
> there
> > a way to set this up without going with a full J2EE container?
> >
> > Cheers,
> > Dave.
> >
>

Re: Transactional events

Posted by "John D. Ament" <jo...@apache.org>.
What version of weld are you using?

On Dec 31, 2016 21:02, "Dave Oxley" <da...@oxley.email> wrote:

> Hi,
>
> I'm writing a simple app with Deltaspike JPA, Hibernate and Weld targeting
> Tomcat 8 which is working well. I need to setup an Event that is
> @Observes(during = TransactionPhase.AFTER_SUCCESS) but the event is being
> received when it's fired rather than when the transaction commits. Is there
> a way to set this up without going with a full J2EE container?
>
> Cheers,
> Dave.
>