[ 
https://issues.apache.org/jira/browse/OFBIZ-9908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16788671#comment-16788671
 ] 

Ankush Upadhyay commented on OFBIZ-9908:
----------------------------------------

[~rohit.hukkeri], [~jacques.le.roux],

At first glance, it seems that ShoppingList entity is getting locked by service 
*createShoppingList* that does not released when service 
*checkShoppingListItemSecurity*  which is calling from *createShoppingListItem* 
service def and that causing *A lock could not be obtained within the time 
requested* issue and failure of *checkShoppingListItemSecurity*.

Here are the logs:

{code}

=======shoppingListId=======
2019-03-09 18:31:29,224 |jsse-nio-8443-exec-6 |Log |I| 
[ShoppingListServices.xml#checkShoppingListSecurity line 242] 
====enter=======checkShoppingListSecurity=============
2019-03-09 18:31:29,226 |jsse-nio-8443-exec-6 |Log |I| 
[ShoppingListServices.xml#checkShoppingListSecurity line 262] 
====done=======checkShoppingListSecurity=============
2019-03-09 18:31:29,227 |jsse-nio-8443-exec-6 |ServiceDispatcher |T| Sync 
service [order/checkShoppingListSecurity] finished in [23] milliseconds
2019-03-09 18:31:29,227 |jsse-nio-8443-exec-6 |ServiceEcaCondition |I| From 
Field (shippingMethodString) is not found in context for createShoppingList, 
defaulting to null.
2019-03-09 18:31:29,227 |jsse-nio-8443-exec-6 |ServiceEcaRule |I| For Service 
ECA [createShoppingList] on [in-validate] got false for condition: 
[shippingMethodString][is-not-empty][true][String]
2019-03-09 18:31:29,227 |jsse-nio-8443-exec-6 |ServiceEcaCondition |I| From 
Field (frequency) is not found in context for createShoppingList, defaulting to 
null.
2019-03-09 18:31:29,227 |jsse-nio-8443-exec-6 |ServiceEcaRule |I| For Service 
ECA [createShoppingList] on [in-validate] got false for condition: 
[frequency][is-not-empty][true][String]
2019-03-09 18:31:29,288 |jsse-nio-8443-exec-6 |SequenceUtil |I| Got bank of 
sequenced IDs for [ShoppingList]; curSeqId=10130, maxSeqId=10140, bankSize=10
2019-03-09 18:31:29,357 |jsse-nio-8443-exec-6 |ServiceDispatcher |T| Sync 
service [order/createShoppingList] finished in [153] milliseconds
2019-03-09 18:31:29,357 |jsse-nio-8443-exec-6 |ShoppingListEvents |I| Adding 
cart item to shopping list [10130], allowPromo=true, item.getIsPromo()=false, 
item.getProductId()=GZ-2644, item.getQuantity()=2.00
2019-03-09 18:31:29,358 |jsse-nio-8443-exec-6 |NoModule |O| 
=============ctx===============\{userLogin=[GenericEntity:UserLogin][createdStamp,2019-03-09
 10:37:23.13(java.sql.Timestamp)][createdTxStamp,2019-03-09 
10:37:23.096(java.sql.Timestamp)][currentPassword,{SHA}47b56994cbc2b6d10aa1be30f70165adb305a41a(java.lang.String)][disabledBy,null()][disabledDateTime,null()][enabled,Y(java.lang.String)][externalAuthId,null()][hasLoggedOut,N(java.lang.String)][isSystem,null()][lastCurrencyUom,null()][lastLocale,en(java.lang.String)][lastTimeZone,Asia/Calcutta(java.lang.String)][lastUpdatedStamp,2019-03-09
 17:32:29.011(java.sql.Timestamp)][lastUpdatedTxStamp,2019-03-09 
17:32:29.011(java.sql.Timestamp)][partyId,admin(java.lang.String)][passwordHint,null()][requirePasswordChange,null()][successiveFailedLogins,null()][userLdapDn,null()][userLoginId,admin(java.lang.String)],
 quantity=2.00, reservLength=0, shoppingListId=10130, productId=GZ-2644, 
reservPersons=0, reservStart=null}
2019-03-09 18:31:29,363 |jsse-nio-8443-exec-6 |Log |I| 
[ShoppingListServices.xml#checkShoppingListItemSecurity line 267] 
===enter========checkShoppingListItemSecurity=============
2019-03-09 18:32:29,374 |jsse-nio-8443-exec-6 |EntityListIterator |W| Warning: 
auto-closed EntityListIterator because of exception: 
java.sql.SQLTransactionRollbackException: A lock could not be obtained within 
the time requested
2019-03-09 18:32:29,374 |jsse-nio-8443-exec-6 |EntityListIterator |W| This 
EntityListIterator for Entity [ShoppingList] has already been closed, not 
closing again.
2019-03-09 18:32:29,375 |jsse-nio-8443-exec-6 |GenericDelegator |E| Failure in 
findByCondition operation for entity [ShoppingList]: 
org.apache.ofbiz.entity.GenericEntityException: Error getting the next result 
(A lock could not be obtained within the time requested). Rolling back 
transaction.
org.apache.ofbiz.entity.GenericEntityException: Error getting the next result 
(A lock could not be obtained within the time requested)
 at 
org.apache.ofbiz.entity.util.EntityListIterator.getCompleteList(EntityListIterator.java:429)
 ~[ofbiz.jar:?]
 at 
org.apache.ofbiz.entity.GenericDelegator.findList(GenericDelegator.java:1581) 
[ofbiz.jar:?]
 at org.apache.ofbiz.entity.util.EntityQuery.query(EntityQuery.java:451) 
[ofbiz.jar:?]
 at org.apache.ofbiz.entity.util.EntityQuery.queryList(EntityQuery.java:381) 
[ofbiz.jar:?]
 at org.apache.ofbiz.entity.util.EntityQuery.queryOne(EntityQuery.java:423) 
[ofbiz.jar:?]
 at 
org.apache.ofbiz.entity.finder.PrimaryKeyFinder.runFind(PrimaryKeyFinder.java:152)
 [ofbiz.jar:?]
 at 
org.apache.ofbiz.entity.finder.PrimaryKeyFinder.runFind(PrimaryKeyFinder.java:87)
 [ofbiz.jar:?]
 at 
org.apache.ofbiz.minilang.method.entityops.EntityOne.exec(EntityOne.java:58) 
[ofbiz.jar:?]
 at org.apache.ofbiz.minilang.SimpleMethod.runSubOps(SimpleMethod.java:310) 
[ofbiz.jar:?]
 at org.apache.ofbiz.minilang.SimpleMethod.exec(SimpleMethod.java:457) 
[ofbiz.jar:?]
 at 
org.apache.ofbiz.minilang.SimpleMethod.runSimpleMethod(SimpleMethod.java:274) 
[ofbiz.jar:?]
 at 
org.apache.ofbiz.minilang.SimpleMethod.runSimpleService(SimpleMethod.java:293) 
[ofbiz.jar:?]
 at 
org.apache.ofbiz.minilang.SimpleServiceEngine.serviceInvoker(SimpleServiceEngine.java:79)
 [ofbiz.jar:?]
 at 
org.apache.ofbiz.minilang.SimpleServiceEngine.runSync(SimpleServiceEngine.java:48)
 [ofbiz.jar:?]
 at 
org.apache.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:403) 
[ofbiz.jar:?]
 at 
org.apache.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:228) 
[ofbiz.jar:?]
 at 
org.apache.ofbiz.service.GenericDispatcherFactory$GenericDispatcher.runSync(GenericDispatcherFactory.java:103)
 [ofbiz.jar:?]

{code}
So I think it should behave the same with mysql(I did not check yet).
One of possible workaround is calling *createShoppingList* with new transaction 
to resolve this deadlock issue.
 

> Quick Add button for shopping list on Orderentry screen is not working
> ----------------------------------------------------------------------
>
>                 Key: OFBIZ-9908
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-9908
>             Project: OFBiz
>          Issue Type: Bug
>          Components: order
>            Reporter: Garima jain
>            Assignee: Rohit Hukkeri
>            Priority: Major
>          Time Spent: 72h
>  Remaining Estimate: 0h
>
> steps to generate 
> 1. Navigate to https://demo-trunk.ofbiz.apache.org/ordermgr/control/orderentry
> 2. Press continue on sales order screen.
> 3. Add any finished good  product to the sales order
> 4. In 'Add Order Items to Shopping List' section, select 'new shopping list' 
> from the drop down and click on 'Add to shopping list' button
> 5. you navigate to 'addBulkToShoppingList' screen, click on 'Quick Add' 
> button.
> Issue: The quick add button is not working.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to