BTM can run standalone?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

BTM can run standalone?

samytux
Greetings, I'm Samantha Gamboa and I write you to see if you can enlighten me concern:
I want to create the following scenario: A client application with its own database starts a transaction that involves resources from other 2 different databases that are in two different web services.
With all the code that I have observed and followed, I saw that the transactionmanager is running in the same process as the client application. Is there any way to BTM run by a different client process?
Like, for example, JOTM, which can be run standalone.
Have you seen any implementation similar to the one I want to do?
Thanks for your responses.

Atte. Samantha.


--
Saludos,

Samantha M. Gamboa Q.

Reply | Threaded
Open this post in threaded view
|

Re: BTM can run standalone?

Ludovic Orban-2

If I understand your use-case correctly, you're looking for a way to make a transaction cross multiple JVMs through web services.

What you're looking for is a transaction manager with support for transaction context propagation. There are only two protocols supporting this: Corba's IIOP and SOAP's WS-AT and none of them are supported by BTM and usually are a very bad idea anyway.

But I'm not sure I correctly understood what you're trying to achieve. Could you please explain that in more details?


2011/4/26 Samantha Gamboa <[hidden email]>
Greetings, I'm Samantha Gamboa and I write you to see if you can enlighten me concern:
I want to create the following scenario: A client application with its own database starts a transaction that involves resources from other 2 different databases that are in two different web services.
With all the code that I have observed and followed, I saw that the transactionmanager is running in the same process as the client application. Is there any way to BTM run by a different client process?
Like, for example, JOTM, which can be run standalone.
Have you seen any implementation similar to the one I want to do?
Thanks for your responses.

Atte. Samantha.


--
Saludos,

Samantha M. Gamboa Q.


Reply | Threaded
Open this post in threaded view
|

Re: BTM can run standalone?

samytux
> If I understand your use-case correctly, you're looking for a way to
> make a transaction cross multiple JVMs through web services.

Yes it's what I want, I'll describe further:

I have two services, the first one is a workflow engine, it is in
charge of keeping the state of several process and changing that state
in response of external events. Events are sent to the engine through
a web-service. The second one is a scheduler (or timer), it's a simple
web-service that by request calls back another web-service at a
certain date/time. The workflow engine also relies on the scheduler to
handle automatic state changes. The third actor is an application. It
uses both of the mentioned above services and also stores some data in
local a database. I plan in the future add additional services to the
mentioned above (for example a document server, a user authentication
/ directory server, etc.).

Currently, everything is running on the same virtual machine and
against the same database. I would like first to distribute the data
along several databases, but i would also like to distribute the
services along different servers.

The problem is that I need to have transactional behavior between the
local database and the services, for example, I should not change the
state in the workflow engine and then fail to save some data to the
local database. Or change the state in the workflow engine and fail to
properly add a task request to the scheduler. Consequences of this
would be catastrophic.

I was trying to define some kind of transaction schema to achieve what
I want. One of my options is to adapt, or implement some simple
transactional schema for web services and therefore i started on top
of BTM. I don't want something complicated, in fact I'm avoiding J2EE
stuff as much as I can.

> What you're looking for is a transaction manager with support for transaction context
> propagation. There are only two protocols supporting this: Corba's IIOP and SOAP's WS-AT
> and none of them are supported by BTM and usually are a very bad idea anyway.

I would like to hear any comment or get some pointers about the
general idea and why it's usually a very bad idea to have transactions
this way. Also what alternatives you think I should use. I have been
looking for a reliable well maintained transaction manager that
supports SOAP WS-AT and that works well with Java but so far no luck.

By the way, this crazy project I'm in is part of my undergraduate
thesis, so I really will appreciate any comment or link or pointer you
could give me :)

Best Regards

Samantha Gamboa

On Tue, Apr 26, 2011 at 9:11 AM, Ludovic Orban <[hidden email]> wrote:

If I understand your use-case correctly, you're looking for a way to make a transaction cross multiple JVMs through web services.

What you're looking for is a transaction manager with support for transaction context propagation. There are only two protocols supporting this: Corba's IIOP and SOAP's WS-AT and none of them are supported by BTM and usually are a very bad idea anyway.

But I'm not sure I correctly understood what you're trying to achieve. Could you please explain that in more details?



2011/4/26 Samantha Gamboa <[hidden email]>
Greetings, I'm Samantha Gamboa and I write you to see if you can enlighten me concern:
I want to create the following scenario: A client application with its own database starts a transaction that involves resources from other 2 different databases that are in two different web services.
With all the code that I have observed and followed, I saw that the transactionmanager is running in the same process as the client application. Is there any way to BTM run by a different client process?
Like, for example, JOTM, which can be run standalone.
Have you seen any implementation similar to the one I want to do?
Thanks for your responses.

Atte. Samantha.


--
Saludos,

Samantha M. Gamboa Q.




Reply | Threaded
Open this post in threaded view
|

Re: BTM can run standalone?

Ludovic Orban-2
Samantha,

I'm sorry to get back to you only after such a long delay.


If my understanding of your project is right, you're looking for a way to make workflow state changes atomic. ACID transactions nearly always are ill-suited for that kind of task as they tend to lock the resources for unreasonable amount of times. In a nutshell, you can think that the whole duration of transition from state A to state B has to be locked but this transition can take minutes, hours or days to complete in some certain workflows. My explanation is schematic but is a reasonable approximation of the truth.

Compensating transactions usually are the solution to that problem. Have a look at this article to get an idea of what it's all about: http://www.theserverside.com/news/1365143/ACID-is-Good-Take-it-in-Short-Doses


BTM only does plain old ACID transactions over the XA protocol, it cannot do compensating transactions at all. If that's what you're looking for, you'll either have to build the compensation part on top of BTM or look elsewhere to find a working implementation.

Good luck,
Ludovic


2011/5/4 Samantha Gamboa <[hidden email]>
> If I understand your use-case correctly, you're looking for a way to
> make a transaction cross multiple JVMs through web services.

Yes it's what I want, I'll describe further:

I have two services, the first one is a workflow engine, it is in
charge of keeping the state of several process and changing that state
in response of external events. Events are sent to the engine through
a web-service. The second one is a scheduler (or timer), it's a simple
web-service that by request calls back another web-service at a
certain date/time. The workflow engine also relies on the scheduler to
handle automatic state changes. The third actor is an application. It
uses both of the mentioned above services and also stores some data in
local a database. I plan in the future add additional services to the
mentioned above (for example a document server, a user authentication
/ directory server, etc.).

Currently, everything is running on the same virtual machine and
against the same database. I would like first to distribute the data
along several databases, but i would also like to distribute the
services along different servers.

The problem is that I need to have transactional behavior between the
local database and the services, for example, I should not change the
state in the workflow engine and then fail to save some data to the
local database. Or change the state in the workflow engine and fail to
properly add a task request to the scheduler. Consequences of this
would be catastrophic.

I was trying to define some kind of transaction schema to achieve what
I want. One of my options is to adapt, or implement some simple
transactional schema for web services and therefore i started on top
of BTM. I don't want something complicated, in fact I'm avoiding J2EE
stuff as much as I can.


> What you're looking for is a transaction manager with support for transaction context
> propagation. There are only two protocols supporting this: Corba's IIOP and SOAP's WS-AT
> and none of them are supported by BTM and usually are a very bad idea anyway.

I would like to hear any comment or get some pointers about the
general idea and why it's usually a very bad idea to have transactions
this way. Also what alternatives you think I should use. I have been
looking for a reliable well maintained transaction manager that
supports SOAP WS-AT and that works well with Java but so far no luck.

By the way, this crazy project I'm in is part of my undergraduate
thesis, so I really will appreciate any comment or link or pointer you
could give me :)

Best Regards

Samantha Gamboa

On Tue, Apr 26, 2011 at 9:11 AM, Ludovic Orban <[hidden email]> wrote:

If I understand your use-case correctly, you're looking for a way to make a transaction cross multiple JVMs through web services.

What you're looking for is a transaction manager with support for transaction context propagation. There are only two protocols supporting this: Corba's IIOP and SOAP's WS-AT and none of them are supported by BTM and usually are a very bad idea anyway.

But I'm not sure I correctly understood what you're trying to achieve. Could you please explain that in more details?



2011/4/26 Samantha Gamboa <[hidden email]>
Greetings, I'm Samantha Gamboa and I write you to see if you can enlighten me concern:
I want to create the following scenario: A client application with its own database starts a transaction that involves resources from other 2 different databases that are in two different web services.
With all the code that I have observed and followed, I saw that the transactionmanager is running in the same process as the client application. Is there any way to BTM run by a different client process?
Like, for example, JOTM, which can be run standalone.
Have you seen any implementation similar to the one I want to do?
Thanks for your responses.

Atte. Samantha.


--
Saludos,

Samantha M. Gamboa Q.