You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Tankov, Nikolai" <ni...@sap.com> on 2010/01/13 14:40:42 UTC

Transaction samples

Hi,

  I was checking the examples and saw that there are no examples which demonstrate how transactions (JTA Transaction Services Specification) and DB drivers (JDBC Service Specification) can be used.
Do you plan to include transactional scenario in one of the existing examples? If no I can extend Derby bundle with an implement of interface org.osgi.service.jdbc.DataSourceFactory defined into OSGi enterprise spec. After that I can use it together with the existing transaction implementation in a simple example.
What do you think about this idea?

The implementation of JTA DataSource for JPA is also interesting. Are there any plans for an implementation? Or it is implemented but I did not found it :)

Thanks!
  Nikolai.



Re: Transaction samples

Posted by Ian Robinson <ia...@googlemail.com>.
Hi Nikolai.
I'm not aware of any Aries work yet around the Enterprise OSGi JDBC spec 
so a contribution that provides and registers a DataSourceFactory for 
Derby would be very useful.
A new sample that demonstrated this would be ideal; and enlistment of 
JTA DataSources with the JTA Transaction Manager service would be a good 
demonstration of the JTA RI and potentially useful for container-managed 
JPA in the future. So I don't think there is any overlap with what 
you're describing with any existing work in Aries.

Regards,
Ian

On 13/01/2010 13:40, Tankov, Nikolai wrote:
> Hi,
>
>   I was checking the examples and saw that there are no examples which demonstrate how transactions (JTA Transaction Services Specification) and DB drivers (JDBC Service Specification) can be used.
> Do you plan to include transactional scenario in one of the existing examples? If no I can extend Derby bundle with an implement of interface org.osgi.service.jdbc.DataSourceFactory defined into OSGi enterprise spec. After that I can use it together with the existing transaction implementation in a simple example.
> What do you think about this idea?
>
> The implementation of JTA DataSource for JPA is also interesting. Are there any plans for an implementation? Or it is implemented but I did not found it :)
>
> Thanks!
>   Nikolai.
>
>
>
>   

RE: Transaction samples

Posted by "Tankov, Nikolai" <ni...@sap.com>.
Hi, 
 
  I also prefer to start with an examples of the transactional model described into OSGi JTA and JDBC spec. I hope that next week I will commit these small examples into samples. 
 
  DataSource which automatically enlists connections into available transaction is not required by the spec but this feature is needed from other modules and I think that aries should provide it. One way to implement it is to stick to the j2ca but this is too heavy implementation from my point of view. I saw that a development of transactional DataSource was started in apache commons DBCP project. Probably it will be good to use it or to contribute to it if it is not ready. 

Thanks, 
 Nikolai.

-----Original Message-----
From: alasdair.nottingham@gmail.com [mailto:alasdair.nottingham@gmail.com] On Behalf Of Alasdair Nottingham
Sent: Thursday, 14. January 2010 11:24
To: aries-dev@incubator.apache.org
Subject: Re: Transaction samples

That is an interesting idea, but I think for now we should stick with
using the OSGi JDBC spec approach.

Alasdair

2010/1/13 David Jencks <da...@yahoo.com>:
>
> On Jan 13, 2010, at 7:05 AM, Timothy Ward wrote:
>
>>
>> Hi Nikolai,
>>
>> I also agree that it would be great to include transactions in our
>> samples. Obviously part of that involves enlisting XA resources with the
>> transaction manager. I believe that the best way to do this is, as Alasdair
>> says, to adapt the XADataSource into a vanilla DataSource, with some
>> automatic logic to enlist the XAConnections in active transactions.
>
> I think that the way to do this is to use j2ca for connection pooling and
> transaction enlistment and wrapping the XADatasource in a j2ca connector.
>  The geronimo connector framework is already available as bundles and the
> tranql jdbc wrappers seem to work OK in an osgi environment.
>
> thanks
> david jencks
>
>>
>> JPA does make use of a JTA DataSource in managed environments, but the JPA
>> provider expects to be provided with a DataSource that is automatically
>> enlisted, not an XADataSource. This is another reason why the implementation
>> Alasdair suggests would be useful. We could then re-use one implementation
>> throughout Aries, rather than having a specific implementation for the JPA
>> container.
>>
>> As far as I am aware there is no implementation that provides this
>> behaviour in Aries, so it would definitely be welcome if you wanted to
>> provide it.
>>
>> Regards,
>>
>> Tim
>>
>>
>>
>>> Date: Wed, 13 Jan 2010 14:25:35 +0000
>>> Subject: Re: Transaction samples
>>> From: not@apache.org
>>> To: aries-dev@incubator.apache.org
>>>
>>> Hi Nikolai,
>>>
>>> I agree we definitely need to have a sample showing how transactions
>>> work. I had been thinking of updating the blog sample to include
>>> transactions, but nothing immediate. If you want to go ahead and
>>> either update the blog sample, or introduce a new one I think that
>>> would be great.
>>>
>>> Since you mention the JDBC specification for derby I think it would be
>>> good to have an implementation of this. It would be really nice if it
>>> could adapt the XADataSource into a DataSource so the client would
>>> just use the DataSource API, and would implicitly get the transaction
>>> enlistment. I would do this separately from the sample and the derby
>>> bundle you mention.
>>>
>>> I'm not sure I can answer your JPA question, but other will be able to.
>>>
>>> Thanks
>>> Alasdair
>>>
>>>
>>> 2010/1/13 Tankov, Nikolai <ni...@sap.com>:
>>>>
>>>> Hi,
>>>>
>>>> I was checking the examples and saw that there are no examples which
>>>> demonstrate how transactions (JTA Transaction Services Specification) and DB
>>>> drivers (JDBC Service Specification) can be used.
>>>> Do you plan to include transactional scenario in one of the existing
>>>> examples? If no I can extend Derby bundle with an implement of interface
>>>> org.osgi.service.jdbc.DataSourceFactory defined into OSGi enterprise spec.
>>>> After that I can use it together with the existing transaction
>>>> implementation in a simple example.
>>>> What do you think about this idea?
>>>>
>>>> The implementation of JTA DataSource for JPA is also interesting. Are
>>>> there any plans for an implementation? Or it is implemented but I did not
>>>> found it :)
>>>>
>>>> Thanks!
>>>> Nikolai.
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Alasdair Nottingham
>>> not@apache.org
>>
>>
>> _________________________________________________________________
>> Tell us your greatest, weirdest and funniest Hotmail stories
>> http://clk.atdmt.com/UKM/go/195013117/direct/01/
>
>



-- 
Alasdair Nottingham
not@apache.org

Re: Transaction samples

Posted by Alasdair Nottingham <no...@apache.org>.
That is an interesting idea, but I think for now we should stick with
using the OSGi JDBC spec approach.

Alasdair

2010/1/13 David Jencks <da...@yahoo.com>:
>
> On Jan 13, 2010, at 7:05 AM, Timothy Ward wrote:
>
>>
>> Hi Nikolai,
>>
>> I also agree that it would be great to include transactions in our
>> samples. Obviously part of that involves enlisting XA resources with the
>> transaction manager. I believe that the best way to do this is, as Alasdair
>> says, to adapt the XADataSource into a vanilla DataSource, with some
>> automatic logic to enlist the XAConnections in active transactions.
>
> I think that the way to do this is to use j2ca for connection pooling and
> transaction enlistment and wrapping the XADatasource in a j2ca connector.
>  The geronimo connector framework is already available as bundles and the
> tranql jdbc wrappers seem to work OK in an osgi environment.
>
> thanks
> david jencks
>
>>
>> JPA does make use of a JTA DataSource in managed environments, but the JPA
>> provider expects to be provided with a DataSource that is automatically
>> enlisted, not an XADataSource. This is another reason why the implementation
>> Alasdair suggests would be useful. We could then re-use one implementation
>> throughout Aries, rather than having a specific implementation for the JPA
>> container.
>>
>> As far as I am aware there is no implementation that provides this
>> behaviour in Aries, so it would definitely be welcome if you wanted to
>> provide it.
>>
>> Regards,
>>
>> Tim
>>
>>
>>
>>> Date: Wed, 13 Jan 2010 14:25:35 +0000
>>> Subject: Re: Transaction samples
>>> From: not@apache.org
>>> To: aries-dev@incubator.apache.org
>>>
>>> Hi Nikolai,
>>>
>>> I agree we definitely need to have a sample showing how transactions
>>> work. I had been thinking of updating the blog sample to include
>>> transactions, but nothing immediate. If you want to go ahead and
>>> either update the blog sample, or introduce a new one I think that
>>> would be great.
>>>
>>> Since you mention the JDBC specification for derby I think it would be
>>> good to have an implementation of this. It would be really nice if it
>>> could adapt the XADataSource into a DataSource so the client would
>>> just use the DataSource API, and would implicitly get the transaction
>>> enlistment. I would do this separately from the sample and the derby
>>> bundle you mention.
>>>
>>> I'm not sure I can answer your JPA question, but other will be able to.
>>>
>>> Thanks
>>> Alasdair
>>>
>>>
>>> 2010/1/13 Tankov, Nikolai <ni...@sap.com>:
>>>>
>>>> Hi,
>>>>
>>>> I was checking the examples and saw that there are no examples which
>>>> demonstrate how transactions (JTA Transaction Services Specification) and DB
>>>> drivers (JDBC Service Specification) can be used.
>>>> Do you plan to include transactional scenario in one of the existing
>>>> examples? If no I can extend Derby bundle with an implement of interface
>>>> org.osgi.service.jdbc.DataSourceFactory defined into OSGi enterprise spec.
>>>> After that I can use it together with the existing transaction
>>>> implementation in a simple example.
>>>> What do you think about this idea?
>>>>
>>>> The implementation of JTA DataSource for JPA is also interesting. Are
>>>> there any plans for an implementation? Or it is implemented but I did not
>>>> found it :)
>>>>
>>>> Thanks!
>>>> Nikolai.
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Alasdair Nottingham
>>> not@apache.org
>>
>>
>> _________________________________________________________________
>> Tell us your greatest, weirdest and funniest Hotmail stories
>> http://clk.atdmt.com/UKM/go/195013117/direct/01/
>
>



-- 
Alasdair Nottingham
not@apache.org

Re: Transaction samples

Posted by David Jencks <da...@yahoo.com>.
On Jan 13, 2010, at 7:05 AM, Timothy Ward wrote:

>
> Hi Nikolai,
>
> I also agree that it would be great to include transactions in our  
> samples. Obviously part of that involves enlisting XA resources with  
> the transaction manager. I believe that the best way to do this is,  
> as Alasdair says, to adapt the XADataSource into a vanilla  
> DataSource, with some automatic logic to enlist the XAConnections in  
> active transactions.

I think that the way to do this is to use j2ca for connection pooling  
and transaction enlistment and wrapping the XADatasource in a j2ca  
connector.  The geronimo connector framework is already available as  
bundles and the tranql jdbc wrappers seem to work OK in an osgi  
environment.

thanks
david jencks

>
> JPA does make use of a JTA DataSource in managed environments, but  
> the JPA provider expects to be provided with a DataSource that is  
> automatically enlisted, not an XADataSource. This is another reason  
> why the implementation Alasdair suggests would be useful. We could  
> then re-use one implementation throughout Aries, rather than having  
> a specific implementation for the JPA container.
>
> As far as I am aware there is no implementation that provides this  
> behaviour in Aries, so it would definitely be welcome if you wanted  
> to provide it.
>
> Regards,
>
> Tim
>
>
>
>> Date: Wed, 13 Jan 2010 14:25:35 +0000
>> Subject: Re: Transaction samples
>> From: not@apache.org
>> To: aries-dev@incubator.apache.org
>>
>> Hi Nikolai,
>>
>> I agree we definitely need to have a sample showing how transactions
>> work. I had been thinking of updating the blog sample to include
>> transactions, but nothing immediate. If you want to go ahead and
>> either update the blog sample, or introduce a new one I think that
>> would be great.
>>
>> Since you mention the JDBC specification for derby I think it would  
>> be
>> good to have an implementation of this. It would be really nice if it
>> could adapt the XADataSource into a DataSource so the client would
>> just use the DataSource API, and would implicitly get the transaction
>> enlistment. I would do this separately from the sample and the derby
>> bundle you mention.
>>
>> I'm not sure I can answer your JPA question, but other will be able  
>> to.
>>
>> Thanks
>> Alasdair
>>
>>
>> 2010/1/13 Tankov, Nikolai <ni...@sap.com>:
>>> Hi,
>>>
>>> I was checking the examples and saw that there are no examples  
>>> which demonstrate how transactions (JTA Transaction Services  
>>> Specification) and DB drivers (JDBC Service Specification) can be  
>>> used.
>>> Do you plan to include transactional scenario in one of the  
>>> existing examples? If no I can extend Derby bundle with an  
>>> implement of interface org.osgi.service.jdbc.DataSourceFactory  
>>> defined into OSGi enterprise spec. After that I can use it  
>>> together with the existing transaction implementation in a simple  
>>> example.
>>> What do you think about this idea?
>>>
>>> The implementation of JTA DataSource for JPA is also interesting.  
>>> Are there any plans for an implementation? Or it is implemented  
>>> but I did not found it :)
>>>
>>> Thanks!
>>> Nikolai.
>>>
>>>
>>>
>>
>>
>>
>> -- 
>> Alasdair Nottingham
>> not@apache.org
> 		 	   		
> _________________________________________________________________
> Tell us your greatest, weirdest and funniest Hotmail stories
> http://clk.atdmt.com/UKM/go/195013117/direct/01/


RE: Transaction samples

Posted by Timothy Ward <ti...@apache.org>.
Hi Nikolai,

I also agree that it would be great to include transactions in our samples. Obviously part of that involves enlisting XA resources with the transaction manager. I believe that the best way to do this is, as Alasdair says, to adapt the XADataSource into a vanilla DataSource, with some automatic logic to enlist the XAConnections in active transactions.

JPA does make use of a JTA DataSource in managed environments, but the JPA provider expects to be provided with a DataSource that is automatically enlisted, not an XADataSource. This is another reason why the implementation Alasdair suggests would be useful. We could then re-use one implementation throughout Aries, rather than having a specific implementation for the JPA container. 

As far as I am aware there is no implementation that provides this behaviour in Aries, so it would definitely be welcome if you wanted to provide it.

Regards,

Tim



> Date: Wed, 13 Jan 2010 14:25:35 +0000
> Subject: Re: Transaction samples
> From: not@apache.org
> To: aries-dev@incubator.apache.org
> 
> Hi Nikolai,
> 
> I agree we definitely need to have a sample showing how transactions
> work. I had been thinking of updating the blog sample to include
> transactions, but nothing immediate. If you want to go ahead and
> either update the blog sample, or introduce a new one I think that
> would be great.
> 
> Since you mention the JDBC specification for derby I think it would be
> good to have an implementation of this. It would be really nice if it
> could adapt the XADataSource into a DataSource so the client would
> just use the DataSource API, and would implicitly get the transaction
> enlistment. I would do this separately from the sample and the derby
> bundle you mention.
> 
> I'm not sure I can answer your JPA question, but other will be able to.
> 
> Thanks
> Alasdair
> 
> 
> 2010/1/13 Tankov, Nikolai <ni...@sap.com>:
> > Hi,
> >
> >  I was checking the examples and saw that there are no examples which demonstrate how transactions (JTA Transaction Services Specification) and DB drivers (JDBC Service Specification) can be used.
> > Do you plan to include transactional scenario in one of the existing examples? If no I can extend Derby bundle with an implement of interface org.osgi.service.jdbc.DataSourceFactory defined into OSGi enterprise spec. After that I can use it together with the existing transaction implementation in a simple example.
> > What do you think about this idea?
> >
> > The implementation of JTA DataSource for JPA is also interesting. Are there any plans for an implementation? Or it is implemented but I did not found it :)
> >
> > Thanks!
> >  Nikolai.
> >
> >
> >
> 
> 
> 
> -- 
> Alasdair Nottingham
> not@apache.org
 		 	   		  
_________________________________________________________________
Tell us your greatest, weirdest and funniest Hotmail stories
http://clk.atdmt.com/UKM/go/195013117/direct/01/

Re: Transaction samples

Posted by Alasdair Nottingham <no...@apache.org>.
Hi Nikolai,

I agree we definitely need to have a sample showing how transactions
work. I had been thinking of updating the blog sample to include
transactions, but nothing immediate. If you want to go ahead and
either update the blog sample, or introduce a new one I think that
would be great.

Since you mention the JDBC specification for derby I think it would be
good to have an implementation of this. It would be really nice if it
could adapt the XADataSource into a DataSource so the client would
just use the DataSource API, and would implicitly get the transaction
enlistment. I would do this separately from the sample and the derby
bundle you mention.

I'm not sure I can answer your JPA question, but other will be able to.

Thanks
Alasdair


2010/1/13 Tankov, Nikolai <ni...@sap.com>:
> Hi,
>
>  I was checking the examples and saw that there are no examples which demonstrate how transactions (JTA Transaction Services Specification) and DB drivers (JDBC Service Specification) can be used.
> Do you plan to include transactional scenario in one of the existing examples? If no I can extend Derby bundle with an implement of interface org.osgi.service.jdbc.DataSourceFactory defined into OSGi enterprise spec. After that I can use it together with the existing transaction implementation in a simple example.
> What do you think about this idea?
>
> The implementation of JTA DataSource for JPA is also interesting. Are there any plans for an implementation? Or it is implemented but I did not found it :)
>
> Thanks!
>  Nikolai.
>
>
>



-- 
Alasdair Nottingham
not@apache.org