cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Veithen <andreas.veit...@gmail.com>
Subject Re: @Transactional in another thead?
Date Wed, 17 Feb 2010 10:18:40 GMT
Andrew,

Of course the concept already exists in JTA, otherwise Spring would
not be able to do transaction suspension. The added value that Spring
provides in this area is that (1) it offers a single API that is
independent of the actual transaction API used (local transaction,
JTA, Hibernate, etc.) and (2) shields the developer from application
server specific details. With respect to the second point: since you
know the specs so well, you ought to know that TransactionManager is
an API that is exposed to transactional resources, but that the J2EE
specs don't require an app server to expose that API to an application
(unless that has changed in recent versions of the specs). Most
servers do this, but each server does it in a different way. As you
can see, Spring is not just wrapping the existing API "to make it look
like they have done some work"...

That being said, of course using the JTA APIs directly might be an
option for Wadi.

Regards,

Andreas

On Wed, Feb 17, 2010 at 10:44, Andrew Dinn <andrewdinn@googlemail.com> wrote:
> On 02/16/2010 06:25 PM, Andreas Veithen wrote:
>>
>> Spring has a concept called "transaction suspension" which allows you
>> to detach a transaction from a thread. This is primarily used to
>> execute a separate transaction on the same thread (and later resume
>> the original transaction), but this probably can also be used to
>> reattach the transaction to a different thread. So, by googling for
>> "transaction suspension" you may be able to find some information
>> about how to do this.
>
> _Spring_ has this concept? Err, no, not exactly. This is a standard JTA
> operation which is documented in the JTA spec**. Anyone who uses
> transactions in Java ought to read and know this specification (it's not
> very big). At the very least they ought to have looked up the documentation
> of the API classes, Transaction and TransactonManager.
>
> Spring may well have wrapped this up in their own API to make it look like
> they have done some work instead of just packaging someone else's
> implementation. That's business as usual for them.
>
> regards,
>
>
> Andrew Dinn
> -----------
> ** specifically you want:
> javax.transaction.Transaction javax.transaction.TransactionManager.suspend()
> javax.transaction.TransactionManager.resume(javax.transaction.Transaction
> transaction)
>

Mime
View raw message