You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Grant Edwards <a4...@yahoo.com> on 2009/04/14 13:40:44 UTC

processorder + transaction boundires

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 


      

Re: processorder + transaction boundires

Posted by David E Jones <da...@hotwaxmedia.com>.
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


Re: processorder + transaction boundires

Posted by Grant Edwards <a4...@yahoo.com>.
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 <bj...@free-man.net>
To: user@ofbiz.apache.org
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 
> 
> 
>      



      

Re: processorder + transaction boundires

Posted by BJ Freeman <bj...@free-man.net>.
#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 
> 
> 
>       

Re: processorder + transaction boundires

Posted by Grant Edwards <a4...@yahoo.com>.
Thank you David, makes sense.

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




________________________________
From: David E Jones <da...@hotwaxmedia.com>
To: user@ofbiz.apache.org
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
> 
> 


      

Re: processorder + transaction boundires

Posted by David E Jones <da...@hotwaxmedia.com>.
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
>
>