You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aries.apache.org by Philipp Marx <sm...@googlemail.com> on 2013/07/18 23:00:37 UTC

Aries JTA, JPA, and SCR

Hi,

I have a question related to JTA (in JPA) context and SCR:

Is it possible to use the container managed transactions also with SCR/DS?
Or is this only possible via Blueprint?

Furthermore is there any Annotation support for the managing transactions
or must this be done via the Blueprint XML?

Cheers
Philipp

Re: Aries JTA, JPA, and SCR

Posted by Philipp Marx <sm...@googlemail.com>.
Hi Timothy,

thanks for your answer, this makes sense. I still have another question
though:

If I inject the EntityManager via Blueprint into my OSGi-service and I have
multiple clients of this service calling it, don't I have to re-create a
new EntityManager for each request?

I have tried to inject the EntityManagerFactory as well (which works) but
creating a new EntityManager with this instance will only return a non-JTA
aware EntityManager?
I event called joinTransaction() but as soon as I commit the transaction
the underlying dataSource (XA) complains, that the commit might only happen
from the managed transaction...

If using the EntityManager which is being injected everything works, but as
said I don't think I can use it in different requests.

Do you happen to know where my mistake is?

Cheers
Philipp


2013/7/19 Timothy Ward <ti...@apache.org>

> Hi Philipp,
>
> Declarative Services is designed to be an ultra-lightweight injection
> runtime, and so it doesn't include the proxying/interception capabilities
> necessary to support Declarative Qualities of Service like transactions.
> This is one of the primary drivers for choosing blueprint over DS.
>
> There are annotations for managing transactions in Aries blueprint. These
> are contained in the latest (1.0.1) release of
> org.apache.aries.transaction.blueprint.
>
> You can enable annotation support with the following:
>
> <blueprint  xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>             xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.2.0">
>
>     <tx:enable-annotations/>
> 	
> 	<bean id="top" class="org.apache.aries.transaction.pojo.AnnotatedPojo"/>
> </blueprint>
>
>
> I hope this helps!
>
> Tim Ward
> -------------------
> Apache Aries PMC member & Enterprise OSGi advocate
> Enterprise OSGi in Action (http://www.manning.com/cummins)
> -------------------
>
>
> ------------------------------
> Date: Thu, 18 Jul 2013 23:00:37 +0200
> Subject: Aries JTA, JPA, and SCR
> From: smigfu@googlemail.com
> To: user@aries.apache.org
>
>
> Hi,
>
> I have a question related to JTA (in JPA) context and SCR:
>
> Is it possible to use the container managed transactions also with SCR/DS?
> Or is this only possible via Blueprint?
>
> Furthermore is there any Annotation support for the managing transactions
> or must this be done via the Blueprint XML?
>
> Cheers
> Philipp
>

Re: Aries JTA, JPA, and SCR

Posted by Krzysztof Sobkowiak <kr...@gmail.com>.
Hi

The page about Aries Transactions sends the visitor to the OSGi 
specification. Do you plan to write a short manual/quick-start fr this 
module?

Best regards
Krzysztof

On 19.07.2013 10:08, Timothy Ward wrote:
> Hi Philipp,
>
> Declarative Services is designed to be an ultra-lightweight injection 
> runtime, and so it doesn't include the proxying/interception 
> capabilities necessary to support Declarative Qualities of Service 
> like transactions. This is one of the primary drivers for choosing 
> blueprint over DS.
>
> There are annotations for managing transactions in Aries blueprint. 
> These are contained in the latest (1.0.1) release of 
> org.apache.aries.transaction.blueprint.
>
> You can enable annotation support with the following:
>
> <blueprint  xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>              xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.2.0">
>
>      <tx:enable-annotations/>
> 	
> 	<bean id="top" class="org.apache.aries.transaction.pojo.AnnotatedPojo"/>
> </blueprint>
> I hope this helps!
>
> Tim Ward
> -------------------
> Apache Aries PMC member & Enterprise OSGi advocate
> Enterprise OSGi in Action (http://www.manning.com/cummins)
> -------------------
>
>
> ------------------------------------------------------------------------
> Date: Thu, 18 Jul 2013 23:00:37 +0200
> Subject: Aries JTA, JPA, and SCR
> From: smigfu@googlemail.com
> To: user@aries.apache.org
>
> Hi,
>
> I have a question related to JTA (in JPA) context and SCR:
>
> Is it possible to use the container managed transactions also with 
> SCR/DS? Or is this only possible via Blueprint?
>
> Furthermore is there any Annotation support for the managing 
> transactions or must this be done via the Blueprint XML?
>
> Cheers
> Philipp


-- 
Krzysztof Sobkowiak

JEE & OSS Architect | Technical Architect @ Capgemini
e-mail: krzys.sobkowiak@gmail.com <ma...@gmail.com> | 
Twitter: @KSobkowiak

AW: Aries JTA, JPA, and SCR

Posted by "Rudolph, Dirk" <Di...@t-systems.com>.
Hi Daniel,

It's not a performance issue (in our use case). We just made the decision to use SCR/DS before Blueprint in our project (, because we had some problems integrating blueprint).

@Felix: Thanks. I will have a look at the spec again.

Regards,
Dirk

-----Ursprüngliche Nachricht-----
Von: Daniel Rolka [mailto:daniel.rolka@yahoo.com] 
Gesendet: Mittwoch, 24. Juli 2013 13:30
An: user@aries.apache.org
Betreff: Re: Aries JTA, JPA, and SCR

Hi,

Just to kill my curiosity - why do not you want to use Blueprint? Does it decrease performance / increase usage of resources significantly? If so, do you have any profiling results for that?

thanks,
Daniel

--------------------------------------------
On Wed, 7/24/13, Felix Meschberger <fm...@adobe.com> wrote:

 Subject: Re: Aries JTA, JPA, and SCR
 To: "user@aries.apache.org" <us...@aries.apache.org>
 Date: Wednesday, July 24, 2013, 2:34 AM
 
 Hi Dirk,
 Me thinks Aries JTA implements the OSGi JTA spec  (Chapter 123, JTA Transaction Services Specification in the  Enterprise R5 Specification). This should provide  information on how to use it (thinking of "runnning  outside of a container"). As such it should be usable  without requiring Blueprint -- Except that you have to do  the work "manually" that the Blueprint integration  may do for the Blueprint components.
 Disclaimer: I am not an expert on JTA, but I  sincerely hope that this is not requiring  Blueprint.
 Hope this helps.
 RegardsFelix
 Am 24.07.2013 um 11:26 schrieb Rudolph,
 Dirk:
 Hi
 Felix,  we also use Aries JTA in
 Apache Felix (CQ5) using Blueprint. Can you give us a hint  where we can find some documentation on using Aries JTA  without using Blueprint.  Regards,Dirk
  Von: Felix
 Meschberger [mailto:fmeschbe@gmail.com]
 Gesendet: Mittwoch,
 24. Juli 2013 10:01
 An: user@aries.apache.org
 Betreff: Re:
 Aries JTA, JPA, and SCR  Hi Tim  WHile I agree that DS does not have  proxying capability (and should not have such a biest), I  would expect that code making explicit use of OSGi JTA  functionality (even implemented by the Aries JTA bundles) is  very well usable with DS.  In fact, IIRC we once used Aries JTA in  our commercial product without using  Blueprint.  RegardsFelix  Am 19.07.2013 um 10:08 schrieb Timothy
 Ward:
 
 Hi Philipp,  Declarative Services is designed to be an  ultra-lightweight injection runtime, and so it doesn't  include the proxying/interception capabilities necessary to  support Declarative Qualities of Service like transactions.
 This is one of the primary drivers for choosing blueprint  over DS.  There are annotations for managing transactions  in Aries blueprint. These are contained in the latest
 (1.0.1) release of
 org.apache.aries.transaction.blueprint.  You can enable annotation support with the
 following:  <blueprint
 xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
 xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.2.0">
 <tx:enable-annotations/>                <bean  id="top"
 class="org.apache.aries.transaction.pojo.AnnotatedPojo"/></blueprint>
  I hope this helps!
 Tim Ward
 -------------------
 Apache Aries PMC member & Enterprise OSGi advocate  Enterprise OSGi in Action (http://www.manning.com/cummins)
 -------------------
 
 Date: Thu, 18 Jul 2013 23:00:37 +0200
 Subject: Aries JTA, JPA, and SCR
 From: smigfu@googlemail.com
 To: user@aries.apache.orgHi,  I have a question related to JTA (in JPA)  context and SCR:  Is it possible to use the container managed  transactions also with SCR/DS? Or is this only possible via  Blueprint?  Furthermore is there any Annotation support for  the managing transactions or must this be done via the  Blueprint XML?  CheersPhilipp
 

Re: Aries JTA, JPA, and SCR

Posted by Daniel Rolka <da...@yahoo.com>.
Hi,

Just to kill my curiosity - why do not you want to use Blueprint? Does it decrease performance / increase usage of resources significantly? If so, do you have any profiling results for that?

thanks,
Daniel

--------------------------------------------
On Wed, 7/24/13, Felix Meschberger <fm...@adobe.com> wrote:

 Subject: Re: Aries JTA, JPA, and SCR
 To: "user@aries.apache.org" <us...@aries.apache.org>
 Date: Wednesday, July 24, 2013, 2:34 AM
 
 Hi Dirk,
 Me thinks Aries JTA implements the OSGi JTA spec
 (Chapter 123, JTA Transaction Services Specification in the
 Enterprise R5 Specification). This should provide
 information on how to use it (thinking of "runnning
 outside of a container"). As such it should be usable
 without requiring Blueprint -- Except that you have to do
 the work "manually" that the Blueprint integration
 may do for the Blueprint components.
 Disclaimer: I am not an expert on JTA, but I
 sincerely hope that this is not requiring
 Blueprint.
 Hope this helps.
 RegardsFelix
 Am 24.07.2013 um 11:26 schrieb Rudolph,
 Dirk:
 Hi
 Felix,  we also use Aries JTA in
 Apache Felix (CQ5) using Blueprint. Can you give us a hint
 where we can find some documentation on using Aries JTA
 without using Blueprint.  Regards,Dirk
  Von: Felix
 Meschberger [mailto:fmeschbe@gmail.com] 
 Gesendet: Mittwoch,
 24. Juli 2013 10:01
 An: user@aries.apache.org
 Betreff: Re:
 Aries JTA, JPA, and SCR  Hi Tim  WHile I agree that DS does not have
 proxying capability (and should not have such a biest), I
 would expect that code making explicit use of OSGi JTA
 functionality (even implemented by the Aries JTA bundles) is
 very well usable with DS.  In fact, IIRC we once used Aries JTA in
 our commercial product without using
 Blueprint.  RegardsFelix  Am 19.07.2013 um 10:08 schrieb Timothy
 Ward:
 
 Hi Philipp,  Declarative Services is designed to be an
 ultra-lightweight injection runtime, and so it doesn't
 include the proxying/interception capabilities necessary to
 support Declarative Qualities of Service like transactions.
 This is one of the primary drivers for choosing blueprint
 over DS.  There are annotations for managing transactions
 in Aries blueprint. These are contained in the latest
 (1.0.1) release of
 org.apache.aries.transaction.blueprint.  You can enable annotation support with the
 following:  <blueprint 
 xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"           
 xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.2.0">     
 <tx:enable-annotations/>                <bean
 id="top"
 class="org.apache.aries.transaction.pojo.AnnotatedPojo"/></blueprint>
  I hope this helps!
 Tim Ward
 -------------------
 Apache Aries PMC member & Enterprise OSGi advocate
 Enterprise OSGi in Action (http://www.manning.com/cummins)
 -------------------
 
 Date: Thu, 18 Jul 2013 23:00:37 +0200
 Subject: Aries JTA, JPA, and SCR
 From: smigfu@googlemail.com
 To: user@aries.apache.orgHi,  I have a question related to JTA (in JPA)
 context and SCR:  Is it possible to use the container managed
 transactions also with SCR/DS? Or is this only possible via
 Blueprint?  Furthermore is there any Annotation support for
 the managing transactions or must this be done via the
 Blueprint XML?  CheersPhilipp
 

Re: Aries JTA, JPA, and SCR

Posted by Felix Meschberger <fm...@adobe.com>.
Hi Dirk,

Me thinks Aries JTA implements the OSGi JTA spec (Chapter 123, JTA Transaction Services Specification in the Enterprise R5 Specification). This should provide information on how to use it (thinking of "runnning outside of a container"). As such it should be usable without requiring Blueprint -- Except that you have to do the work "manually" that the Blueprint integration may do for the Blueprint components.

Disclaimer: I am not an expert on JTA, but I sincerely hope that this is not requiring Blueprint.

Hope this helps.

Regards
Felix

Am 24.07.2013 um 11:26 schrieb Rudolph, Dirk:

Hi Felix,

we also use Aries JTA in Apache Felix (CQ5) using Blueprint. Can you give us a hint where we can find some documentation on using Aries JTA without using Blueprint.

Regards,
Dirk

Von: Felix Meschberger [mailto:fmeschbe@gmail.com]
Gesendet: Mittwoch, 24. Juli 2013 10:01
An: user@aries.apache.org<ma...@aries.apache.org>
Betreff: Re: Aries JTA, JPA, and SCR

Hi Tim

WHile I agree that DS does not have proxying capability (and should not have such a biest), I would expect that code making explicit use of OSGi JTA functionality (even implemented by the Aries JTA bundles) is very well usable with DS.

In fact, IIRC we once used Aries JTA in our commercial product without using Blueprint.

Regards
Felix

Am 19.07.2013 um 10:08 schrieb Timothy Ward:


Hi Philipp,

Declarative Services is designed to be an ultra-lightweight injection runtime, and so it doesn't include the proxying/interception capabilities necessary to support Declarative Qualities of Service like transactions. This is one of the primary drivers for choosing blueprint over DS.

There are annotations for managing transactions in Aries blueprint. These are contained in the latest (1.0.1) release of org.apache.aries.transaction.blueprint.

You can enable annotation support with the following:


<blueprint  xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"

            xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.2.0">



    <tx:enable-annotations/>



        <bean id="top" class="org.apache.aries.transaction.pojo.AnnotatedPojo"/>

</blueprint>



I hope this helps!

Tim Ward
-------------------
Apache Aries PMC member & Enterprise OSGi advocate
Enterprise OSGi in Action (http://www.manning.com/cummins)
-------------------

________________________________
Date: Thu, 18 Jul 2013 23:00:37 +0200
Subject: Aries JTA, JPA, and SCR
From: smigfu@googlemail.com<ma...@googlemail.com>
To: user@aries.apache.org<ma...@aries.apache.org>
Hi,

I have a question related to JTA (in JPA) context and SCR:

Is it possible to use the container managed transactions also with SCR/DS? Or is this only possible via Blueprint?

Furthermore is there any Annotation support for the managing transactions or must this be done via the Blueprint XML?

Cheers
Philipp


AW: Aries JTA, JPA, and SCR

Posted by "Rudolph, Dirk" <Di...@t-systems.com>.
Hi Felix,

 

we also use Aries JTA in Apache Felix (CQ5) using Blueprint. Can you
give us a hint where we can find some documentation on using Aries JTA
without using Blueprint.

 

Regards,

Dirk

 

Von: Felix Meschberger [mailto:fmeschbe@gmail.com] 
Gesendet: Mittwoch, 24. Juli 2013 10:01
An: user@aries.apache.org
Betreff: Re: Aries JTA, JPA, and SCR

 

Hi Tim

 

WHile I agree that DS does not have proxying capability (and should not
have such a biest), I would expect that code making explicit use of OSGi
JTA functionality (even implemented by the Aries JTA bundles) is very
well usable with DS.

 

In fact, IIRC we once used Aries JTA in our commercial product without
using Blueprint.

 

Regards

Felix

 

Am 19.07.2013 um 10:08 schrieb Timothy Ward:





Hi Philipp,

 

Declarative Services is designed to be an ultra-lightweight injection
runtime, and so it doesn't include the proxying/interception
capabilities necessary to support Declarative Qualities of Service like
transactions. This is one of the primary drivers for choosing blueprint
over DS.

 

There are annotations for managing transactions in Aries blueprint.
These are contained in the latest (1.0.1) release of
org.apache.aries.transaction.blueprint.

 

You can enable annotation support with the following:

 

<blueprint  xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
 
xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.2.0">
 
    <tx:enable-annotations/>
        
        <bean id="top"
class="org.apache.aries.transaction.pojo.AnnotatedPojo"/>
</blueprint>
 

I hope this helps!


Tim Ward
-------------------
Apache Aries PMC member & Enterprise OSGi advocate
Enterprise OSGi in Action (http://www.manning.com/cummins)
-------------------



________________________________

Date: Thu, 18 Jul 2013 23:00:37 +0200
Subject: Aries JTA, JPA, and SCR
From: smigfu@googlemail.com
To: user@aries.apache.org

Hi,

 

I have a question related to JTA (in JPA) context and SCR:

 

Is it possible to use the container managed transactions also with
SCR/DS? Or is this only possible via Blueprint?

 

Furthermore is there any Annotation support for the managing
transactions or must this be done via the Blueprint XML?

 

Cheers

Philipp

 


Re: Aries JTA, JPA, and SCR

Posted by Felix Meschberger <fm...@gmail.com>.
Hi Tim

WHile I agree that DS does not have proxying capability (and should not have such a biest), I would expect that code making explicit use of OSGi JTA functionality (even implemented by the Aries JTA bundles) is very well usable with DS.

In fact, IIRC we once used Aries JTA in our commercial product without using Blueprint.

Regards
Felix

Am 19.07.2013 um 10:08 schrieb Timothy Ward:

> Hi Philipp,
> 
> Declarative Services is designed to be an ultra-lightweight injection runtime, and so it doesn't include the proxying/interception capabilities necessary to support Declarative Qualities of Service like transactions. This is one of the primary drivers for choosing blueprint over DS.
> 
> There are annotations for managing transactions in Aries blueprint. These are contained in the latest (1.0.1) release of org.apache.aries.transaction.blueprint.
> 
> You can enable annotation support with the following:
> 
> <blueprint  xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>             xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.2.0">
> 
>     <tx:enable-annotations/>
> 	
> 	<bean id="top" class="org.apache.aries.transaction.pojo.AnnotatedPojo"/>
> </blueprint>
> 
> I hope this helps!
> 
> Tim Ward
> -------------------
> Apache Aries PMC member & Enterprise OSGi advocate
> Enterprise OSGi in Action (http://www.manning.com/cummins)
> -------------------
> 
> 
> Date: Thu, 18 Jul 2013 23:00:37 +0200
> Subject: Aries JTA, JPA, and SCR
> From: smigfu@googlemail.com
> To: user@aries.apache.org
> 
> Hi,
> 
> I have a question related to JTA (in JPA) context and SCR:
> 
> Is it possible to use the container managed transactions also with SCR/DS? Or is this only possible via Blueprint?
> 
> Furthermore is there any Annotation support for the managing transactions or must this be done via the Blueprint XML?
> 
> Cheers
> Philipp


RE: Aries JTA, JPA, and SCR

Posted by Timothy Ward <ti...@apache.org>.
Hi Philipp,
Declarative Services is designed to be an ultra-lightweight injection runtime, and so it doesn't include the proxying/interception capabilities necessary to support Declarative Qualities of Service like transactions. This is one of the primary drivers for choosing blueprint over DS.
There are annotations for managing transactions in Aries blueprint. These are contained in the latest (1.0.1) release of org.apache.aries.transaction.blueprint.
You can enable annotation support with the following:
<blueprint  xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
            xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.2.0">

    <tx:enable-annotations/>
	
	<bean id="top" class="org.apache.aries.transaction.pojo.AnnotatedPojo"/>
</blueprint>
I hope this helps!
Tim Ward
-------------------
Apache Aries PMC member & Enterprise OSGi advocate
Enterprise OSGi in Action (http://www.manning.com/cummins)
-------------------


Date: Thu, 18 Jul 2013 23:00:37 +0200
Subject: Aries JTA, JPA, and SCR
From: smigfu@googlemail.com
To: user@aries.apache.org

Hi,
I have a question related to JTA (in JPA) context and SCR:
Is it possible to use the container managed transactions also with SCR/DS? Or is this only possible via Blueprint?

Furthermore is there any Annotation support for the managing transactions or must this be done via the Blueprint XML?
CheersPhilipp