Transaction's Rollback failed

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

Transaction's Rollback failed

ExsonQu
Administrator
Dear all,

               I found a serious problem in WorkOrderReceive.php during fixing a bug.

              The transaction roll back failed for following query statement ( It's around at line 450~454).

                      $SQL = "UPDATE locstock
                                SET quantity = locstock.quantity + " . $QuantityReceived . "
                                WHERE locstock.stockid = '" . $_POST['StockID'] . "'
                                AND loccode = '" . $_POST['IntoLocation'] . "'";

                 All of others queries have been rolled back, but only this one failed. It leads to stock quantity updated so the inventory quantity become a mess.

               Any comments are highly appreciated!

               Thanks in advance!

               Best regards!

               Exson

                 
             
Reply | Threaded
Open this post in threaded view
|

Re: Transaction's Rollback failed

ExsonQu
Administrator
Dear all,

             I've found the reason for the atomic transaction feature failure. It is caused by the "Lock Table" sql statement which causes a implicit commit.
             In order to fix this problem, we have to move the GetNextTransNo function outside of the transaction begin statements or remove the lock table sql statement.
             Is any idea for this?

             Thanks and best regards!

              Exson

ExsonQu wrote
Dear all,

               I found a serious problem in WorkOrderReceive.php during fixing a bug.

              The transaction roll back failed for following query statement ( It's around at line 450~454).

                      $SQL = "UPDATE locstock
                                SET quantity = locstock.quantity + " . $QuantityReceived . "
                                WHERE locstock.stockid = '" . $_POST['StockID'] . "'
                                AND loccode = '" . $_POST['IntoLocation'] . "'";

                 All of others queries have been rolled back, but only this one failed. It leads to stock quantity updated so the inventory quantity become a mess.

               Any comments are highly appreciated!

               Thanks in advance!

               Best regards!

               Exson
Reply | Threaded
Open this post in threaded view
|

Re: Transaction's Rollback failed

phildaintree
I can't quite recall - but I think there was a good reason ... at the
time!!
The idea was to release the lock on systypes as soon as possible so that
other transactions could be started without choking at the same time.
The risk though is that the transaction counter is incremented and no
transaction is actually committed. In principle I think the ideal
solution is to have the lock table removed and bring the systypes update
inside the transaction.

Phil

On 2016-07-07 06:11, ExsonQu wrote:

> *Dear all,*
>
>              I've found the reason for the atomic transaction feature
> failure. It is caused by the "Lock Table" sql statement which causes a
> implicit commit.
>              In order to fix this problem, we have to move the
> GetNextTransNo function outside of the transaction begin statements or
> remove the lock table sql statement.
>              Is any idea for this?
>
>              Thanks and best regards!
>
>               Exson
>
>
> ExsonQu wrote*
>> Dear all,
> *
>>
>>                I found a serious problem in WorkOrderReceive.php
>> during
>> fixing a bug.
>>
>>               The transaction roll back failed for following query
>> statement ( It's around at line 450~454).
>>
>>                       $SQL = "UPDATE locstock
>> SET quantity = locstock.quantity + " . $QuantityReceived . "
>> WHERE locstock.stockid = '" . $_POST['StockID'] . "'
>> AND loccode = '" . $_POST['IntoLocation'] . "'";
>>
>>                  All of others queries have been rolled back, but only
>> this one failed. It leads to stock quantity updated so the inventory
>> quantity become a mess.
>>
>>                Any comments are highly appreciated!
>>
>>                Thanks in advance!
>>
>>                Best regards!
>>
>>                Exson
>
>
>
>
>
> --
> View this message in context:
> http://weberp-accounting.1478800.n4.nabble.com/Transaction-s-Rollback-failed-tp4658233p4658628.html
> Sent from the web-ERP-developers mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech
> luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
> _______________________________________________
> Web-erp-developers mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/web-erp-developers


------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Web-erp-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/web-erp-developers
If anyone is wondering about the persistently nasty comments made by Tim Schofield and wants the full story please see: http://timschofield.blogspot.com/ Hell hath no fury like a woman (or Tim) scorned
Reply | Threaded
Open this post in threaded view
|

Re: Transaction's Rollback failed

ExsonQu
Administrator
Hi, Phil,

        Thank you for your quick reply.

        I've changed the table lock to row lock which provides extra safe locking read.

       Thanks and best regards!

       Exson