From: ExsonQu <hex...@gm...> - 2015-05-06 05:47:16
|
*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-tp4658233.html Sent from the web-ERP-developers mailing list archive at Nabble.com. |
From: ExsonQu <hex...@gm...> - 2016-07-07 12:53:55
|
*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. |
From: <ph...@lo...> - 2016-07-08 02:11:46
|
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 > Web...@li... > https://lists.sourceforge.net/lists/listinfo/web-erp-developers |
From: ExsonQu <hex...@gm...> - 2016-07-08 10:17:11
|
*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 -- View this message in context: http://weberp-accounting.1478800.n4.nabble.com/Transaction-s-Rollback-failed-tp4658233p4658631.html Sent from the web-ERP-developers mailing list archive at Nabble.com. |