You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Paul Foxworthy <pa...@cohsoft.com.au> on 2011/10/12 01:09:27 UTC

Should loadSalesInvoiceFact be run on return instead of commit?

Hi all,

Last year the SECA that runs loadSalesInvoiceFact was changed to run async.
See
https://fisheye6.atlassian.com/browse/ofbiz/trunk/applications/accounting/servicedef/secas_olap.xml?hb=true#to29
. 

That makes sense to me, but it's run on commit, (that is, prior to the
commit) and I'm getting errors in the log that the invoice doesn't exist. It
seems that the async loadSalesInvoiceFact is sometimes running before the
transaction is committed on another thread, so it can't see the invoice
data.

Should it be run on return rather than commit?

Thanks

Paul Foxworthy


--
View this message in context: http://ofbiz.135035.n4.nabble.com/Should-loadSalesInvoiceFact-be-run-on-return-instead-of-commit-tp3896289p3896289.html
Sent from the OFBiz - Dev mailing list archive at Nabble.com.

Re: Should loadSalesInvoiceFact be run on return instead of commit?

Posted by Paul Foxworthy <pa...@cohsoft.com.au>.
Hi all,

I've created a Jira issue 4582 for this problem.

Cheers

Paul Foxworthy


Martin Kreidenweis wrote:
> 
> Hi,
> 
>> I see Leon has discovered a similar issue for a different SECA in Jira
>> 4469,
>> but his patch uses global-commit rather than return.
>> 
>> I'm happy to submit a patch, but would Leon's approach be better?
> 
> I think "global-commit" is usually the way to go for async services
> (usually
> "global-commit-post-run" so that the service result is available to the
> async service).
> 
> A SECAs on "return" might also be called way before the actual DB commit
> if the service in question
> is called by another service or SECA that opened the transaction.
> 
> Martin
> 

--
View this message in context: http://ofbiz.135035.n4.nabble.com/Should-loadSalesInvoiceFact-be-run-on-return-instead-of-commit-tp3896289p4087930.html
Sent from the OFBiz - Dev mailing list archive at Nabble.com.

Re: Should loadSalesInvoiceFact be run on return instead of commit?

Posted by Martin Kreidenweis <ma...@tngtech.com>.
Hi,

> I see Leon has discovered a similar issue for a different SECA in Jira 4469,
> but his patch uses global-commit rather than return.
> 
> I'm happy to submit a patch, but would Leon's approach be better?

I think "global-commit" is usually the way to go for async services (usually
"global-commit-post-run" so that the service result is available to the async service).

A SECAs on "return" might also be called way before the actual DB commit if the service in question
is called by another service or SECA that opened the transaction.

Martin

Re: Should loadSalesInvoiceFact be run on return instead of commit?

Posted by Paul Foxworthy <pa...@cohsoft.com.au>.
Thanks Scott.

I see Leon has discovered a similar issue for a different SECA in Jira 4469,
but his patch uses global-commit rather than return.

I'm happy to submit a patch, but would Leon's approach be better?

Cheers

Paul Foxworthy


Scott Gray-2 wrote:
> 
> +1
> 
> Regards
> Scott
> 
> On 12/10/2011, at 12:09 PM, Paul Foxworthy wrote:
> 
>> Hi all,
>> 
>> Last year the SECA that runs loadSalesInvoiceFact was changed to run
>> async.
>> See
>> https://fisheye6.atlassian.com/browse/ofbiz/trunk/applications/accounting/servicedef/secas_olap.xml?hb=true#to29
>> . 
>> 
>> That makes sense to me, but it's run on commit, (that is, prior to the
>> commit) and I'm getting errors in the log that the invoice doesn't exist.
>> It
>> seems that the async loadSalesInvoiceFact is sometimes running before the
>> transaction is committed on another thread, so it can't see the invoice
>> data.
>> 
>> Should it be run on return rather than commit?
>> 
>> Thanks
>> 
>> Paul Foxworthy
>> 
>> 
>> --
>> View this message in context:
>> http://ofbiz.135035.n4.nabble.com/Should-loadSalesInvoiceFact-be-run-on-return-instead-of-commit-tp3896289p3896289.html
>> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
> 

--
View this message in context: http://ofbiz.135035.n4.nabble.com/Should-loadSalesInvoiceFact-be-run-on-return-instead-of-commit-tp3896289p3897004.html
Sent from the OFBiz - Dev mailing list archive at Nabble.com.

Re: Should loadSalesInvoiceFact be run on return instead of commit?

Posted by Scott Gray <sc...@hotwaxmedia.com>.
+1

Regards
Scott

On 12/10/2011, at 12:09 PM, Paul Foxworthy wrote:

> Hi all,
> 
> Last year the SECA that runs loadSalesInvoiceFact was changed to run async.
> See
> https://fisheye6.atlassian.com/browse/ofbiz/trunk/applications/accounting/servicedef/secas_olap.xml?hb=true#to29
> . 
> 
> That makes sense to me, but it's run on commit, (that is, prior to the
> commit) and I'm getting errors in the log that the invoice doesn't exist. It
> seems that the async loadSalesInvoiceFact is sometimes running before the
> transaction is committed on another thread, so it can't see the invoice
> data.
> 
> Should it be run on return rather than commit?
> 
> Thanks
> 
> Paul Foxworthy
> 
> 
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/Should-loadSalesInvoiceFact-be-run-on-return-instead-of-commit-tp3896289p3896289.html
> Sent from the OFBiz - Dev mailing list archive at Nabble.com.