processorder + transaction boundires

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

processorder + transaction boundires

africa4you
Hi,

The processorder request is the first in a long chain of requests that form the order pipe-line, which terminates with the ordercomplete view.
What is not clear to me is where if any are the transaction boundries. For example if the storeOrder service were to fail would work done by all requests in the order pipe-line be rolled back?

Further to this, I have inserted a custom request into the order pipe-line that does the following:
1) Processes booking related info on a 3rd party system.
2) Logs status information to the ofbiz database in a custom table.

Here again would a rollback undo work done by point 2, and any ideas about how best to intercept the rollback so that an "undo" method can be affected on the 3rd parth system.

Kind regards

Grant


     
Reply | Threaded
Open this post in threaded view
|

Re: processorder + transaction boundires

David E Jones-3

In general each event in a request chain runs in its own transaction  
and is responsible for returning a status according to its result, and  
then in the request response definitions you can decide how to have  
the request chain flow based on those responses.

If you want it to be part of the transaction, then looking at the  
underlying service called and using an SECA rule to trigger your  
service is the better way to go.

-David


On Apr 14, 2009, at 5:40 AM, Grant Edwards wrote:

> Hi,
>
> The processorder request is the first in a long chain of requests  
> that form the order pipe-line, which terminates with the  
> ordercomplete view.
> What is not clear to me is where if any are the transaction  
> boundries. For example if the storeOrder service were to fail would  
> work done by all requests in the order pipe-line be rolled back?
>
> Further to this, I have inserted a custom request into the order  
> pipe-line that does the following:
> 1) Processes booking related info on a 3rd party system.
> 2) Logs status information to the ofbiz database in a custom table.
>
> Here again would a rollback undo work done by point 2, and any ideas  
> about how best to intercept the rollback so that an "undo" method  
> can be affected on the 3rd parth system.
>
> Kind regards
>
> Grant
>
>

Reply | Threaded
Open this post in threaded view
|

Re: processorder + transaction boundires

BJ Freeman
In reply to this post by africa4you
#2 if this custom table is not defined as an entity, or is not accessed
through the entity engine, then no transactions will effect it.
It is assumed this table is not in the ofbiz schema also.


Grant Edwards sent the following on 4/14/2009 4:40 AM:

> Hi,
>
> The processorder request is the first in a long chain of requests that form the order pipe-line, which terminates with the ordercomplete view.
> What is not clear to me is where if any are the transaction boundries. For example if the storeOrder service were to fail would work done by all requests in the order pipe-line be rolled back?
>
> Further to this, I have inserted a custom request into the order pipe-line that does the following:
> 1) Processes booking related info on a 3rd party system.
> 2) Logs status information to the ofbiz database in a custom table.
>
> Here again would a rollback undo work done by point 2, and any ideas about how best to intercept the rollback so that an "undo" method can be affected on the 3rd parth system.
>
> Kind regards
>
> Grant
>
>
>      
Reply | Threaded
Open this post in threaded view
|

Re: processorder + transaction boundires

africa4you
Hi,

This table is defined and accessed via the entity engine. Its must form part of any transaction rollback to ensure data integrity.

OrderPipeLine-Start (processorder)  ---> Request-A  ---> Request-B ---> Request-C ---> Request-D ---> OrderPipeLine-End (ordercomplete view)

My questions are as follows:

1) Given the above example where are the transaction boundries. For example, if a service called by Request-C fails does it rollback work done only by Request-C or by all requests (Request-A, Request-B, Request-C) executed to date.

2) While a normal transaction rollback would clean-up the database, is it possible to detect / intercept the rollback and make a call to a 3rd party system to clean-up order related data. I would welcome any suggestions in this regard.

Kind regards

Grant




________________________________
From: BJ Freeman <[hidden email]>
To: [hidden email]
Sent: Tuesday, April 14, 2009 9:21:01 PM
Subject: Re: processorder + transaction boundires

#2 if this custom table is not defined as an entity, or is not accessed
through the entity engine, then no transactions will effect it.
It is assumed this table is not in the ofbiz schema also.


Grant Edwards sent the following on 4/14/2009 4:40 AM:

> Hi,
>
> The processorder request is the first in a long chain of requests that form the order pipe-line, which terminates with the ordercomplete view.
> What is not clear to me is where if any are the transaction boundries. For example if the storeOrder service were to fail would work done by all requests in the order pipe-line be rolled back?
>
> Further to this, I have inserted a custom request into the order pipe-line that does the following:
> 1) Processes booking related info on a 3rd party system.
> 2) Logs status information to the ofbiz database in a custom table.
>
> Here again would a rollback undo work done by point 2, and any ideas about how best to intercept the rollback so that an "undo" method can be affected on the 3rd parth system.
>
> Kind regards
>
> Grant
>
>
>      



     
Reply | Threaded
Open this post in threaded view
|

Re: processorder + transaction boundires

africa4you
In reply to this post by David E Jones-3
Thank you David, makes sense.

Your email ended up in my spam folder, so have only just seen it.




________________________________
From: David E Jones <[hidden email]>
To: [hidden email]
Sent: Tuesday, April 14, 2009 9:04:32 PM
Subject: Re: processorder + transaction boundires


In general each event in a request chain runs in its own transaction and is responsible for returning a status according to its result, and then in the request response definitions you can decide how to have the request chain flow based on those responses.

If you want it to be part of the transaction, then looking at the underlying service called and using an SECA rule to trigger your service is the better way to go.

-David


On Apr 14, 2009, at 5:40 AM, Grant Edwards wrote:

> Hi,
>
> The processorder request is the first in a long chain of requests that form the order pipe-line, which terminates with the ordercomplete view.
> What is not clear to me is where if any are the transaction boundries. For example if the storeOrder service were to fail would work done by all requests in the order pipe-line be rolled back?
>
> Further to this, I have inserted a custom request into the order pipe-line that does the following:
> 1) Processes booking related info on a 3rd party system.
> 2) Logs status information to the ofbiz database in a custom table.
>
> Here again would a rollback undo work done by point 2, and any ideas about how best to intercept the rollback so that an "undo" method can be affected on the 3rd parth system.
>
> Kind regards
>
> Grant
>
>


     
Reply | Threaded
Open this post in threaded view
|

Re: processorder + transaction boundires

David E Jones-3
In reply to this post by africa4you

On Apr 14, 2009, at 2:23 PM, Grant Edwards wrote:

> 2) While a normal transaction rollback would clean-up the database,  
> is it possible to detect / intercept the rollback and make a call to  
> a 3rd party system to clean-up order related data. I would welcome  
> any suggestions in this regard.

This can be done using SECA rules as well. Please take a look at the  
service engine documentation for this. There are options to trigger  
things after a successful commit, or after a failure and rollback.

-David