You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by Ove Ranheim <or...@gmail.com> on 2014/09/29 21:57:16 UTC

Custom TransactionServices in DS/Weld

Hi,

I'd like to register my own TransactionServices implementation (custom NarayanaTransactionServices). Is there a way to register this in DS (config source?), so it would be loaded during WeldBoostrap startup? (https://github.com/stuartwdouglas/weld-core/blob/master/impl/src/main/java/org/jboss/weld/bootstrap/WeldStartup.java#L205)

Here's another example using Bitronix: https://developer.jboss.org/message/848326#848326

Br, Ove


Re: Custom TransactionServices in DS/Weld

Posted by Gerhard Petracek <ge...@gmail.com>.
hi ove,

you should only need it for using javax.enterprise.event.TransactionPhase.
everything else should be supported by deltaspike itself (resource-local as
well as jta).
if you don't need transaction-phase, you shouldn't need the weld specific
spi -> see my first answer.
if you need transaction-phase, the question is offtopic for this list,
because deltaspike doesn't support proprietary parts (except the
container-control part which is just about starting/stopping different
containers and contexts).

regards,
gerhard



2014-10-08 18:04 GMT+02:00 Ove Ranheim <or...@gmail.com>:

> Hi Gerhard
>
> Maybe my question wasn't clear enough. The purpose was to have a custom
> TransactionService (weld-interface) loaded during container boot. I brought
> this up on the [1] JBoss Weld Forum and through [2] WELD-1495.
>
> Thanks to Jozef Hartinger for creating a [3][4] PR today. Weld
> 3.0.0.Alpha2 will most likely support an SPI that allows us to override
> load behaviour of ie. MockTransactionServices in
> arquillian-weld-ee-embedded-1.1 during startup. Basically, Weld can load a
> custom transaction service that overrides an existing bootstrap by other
> integrators.
>
> The BeanManagedUserTransactionStrategy requires JTA service to be
> available by the container in order to be used. I've made my temporary
> patch for Weld 2.2.4 and it works as expected.
>
> Cheers
> Ove
>
> [1] https://developer.jboss.org/message/905533#905533
> [2] https://issues.jboss.org/browse/WELD-1495
> [3] https://github.com/weld/core/pull/682
> [4]
> https://github.com/jharting/core/commit/962f8eff5cc09002c3a45404021108f10cf1fce2
>
>
> On 30 Sep 2014, at 21:02, Gerhard Petracek <ge...@gmail.com>
> wrote:
>
> > hi ove,
> >
> > please have a look at the hints about (a custom) TransactionStrategy (see
> > [1]).
> >
> > regards,
> > gerhard
> >
> > [1] http://deltaspike.apache.org/documentation/jpa.html
> >
> >
> >
> > 2014-09-29 21:57 GMT+02:00 Ove Ranheim <or...@gmail.com>:
> >
> >> Hi,
> >>
> >> I'd like to register my own TransactionServices implementation (custom
> >> NarayanaTransactionServices). Is there a way to register this in DS
> (config
> >> source?), so it would be loaded during WeldBoostrap startup? (
> >>
> https://github.com/stuartwdouglas/weld-core/blob/master/impl/src/main/java/org/jboss/weld/bootstrap/WeldStartup.java#L205
> >> )
> >>
> >> Here's another example using Bitronix:
> >> https://developer.jboss.org/message/848326#848326
> >>
> >> Br, Ove
> >>
> >>
>
>

Re: Custom TransactionServices in DS/Weld

Posted by Ove Ranheim <or...@gmail.com>.
Hi Gerhard

Maybe my question wasn't clear enough. The purpose was to have a custom TransactionService (weld-interface) loaded during container boot. I brought this up on the [1] JBoss Weld Forum and through [2] WELD-1495.

Thanks to Jozef Hartinger for creating a [3][4] PR today. Weld 3.0.0.Alpha2 will most likely support an SPI that allows us to override load behaviour of ie. MockTransactionServices in arquillian-weld-ee-embedded-1.1 during startup. Basically, Weld can load a custom transaction service that overrides an existing bootstrap by other integrators.

The BeanManagedUserTransactionStrategy requires JTA service to be available by the container in order to be used. I've made my temporary patch for Weld 2.2.4 and it works as expected.

Cheers
Ove

[1] https://developer.jboss.org/message/905533#905533
[2] https://issues.jboss.org/browse/WELD-1495
[3] https://github.com/weld/core/pull/682
[4] https://github.com/jharting/core/commit/962f8eff5cc09002c3a45404021108f10cf1fce2


On 30 Sep 2014, at 21:02, Gerhard Petracek <ge...@gmail.com> wrote:

> hi ove,
> 
> please have a look at the hints about (a custom) TransactionStrategy (see
> [1]).
> 
> regards,
> gerhard
> 
> [1] http://deltaspike.apache.org/documentation/jpa.html
> 
> 
> 
> 2014-09-29 21:57 GMT+02:00 Ove Ranheim <or...@gmail.com>:
> 
>> Hi,
>> 
>> I'd like to register my own TransactionServices implementation (custom
>> NarayanaTransactionServices). Is there a way to register this in DS (config
>> source?), so it would be loaded during WeldBoostrap startup? (
>> https://github.com/stuartwdouglas/weld-core/blob/master/impl/src/main/java/org/jboss/weld/bootstrap/WeldStartup.java#L205
>> )
>> 
>> Here's another example using Bitronix:
>> https://developer.jboss.org/message/848326#848326
>> 
>> Br, Ove
>> 
>> 


Re: Custom TransactionServices in DS/Weld

Posted by Gerhard Petracek <ge...@gmail.com>.
hi ove,

please have a look at the hints about (a custom) TransactionStrategy (see
[1]).

regards,
gerhard

[1] http://deltaspike.apache.org/documentation/jpa.html



2014-09-29 21:57 GMT+02:00 Ove Ranheim <or...@gmail.com>:

> Hi,
>
> I'd like to register my own TransactionServices implementation (custom
> NarayanaTransactionServices). Is there a way to register this in DS (config
> source?), so it would be loaded during WeldBoostrap startup? (
> https://github.com/stuartwdouglas/weld-core/blob/master/impl/src/main/java/org/jboss/weld/bootstrap/WeldStartup.java#L205
> )
>
> Here's another example using Bitronix:
> https://developer.jboss.org/message/848326#848326
>
> Br, Ove
>
>