[KULRICE-5011] Implement an improved way to delete RELOAD_ACTION_LIST prefs for users Created: 03/Mar/11 Updated: 09/Sep/11 Resolved: 04/May/11 Status: Project: Component/s: Affects Version/s: Fix Version/s: Security Level: Closed Kuali Rice Development Development None Type: Reporter: Resolution: Labels: Remaining Estimate: Time Spent: Original Estimate: Improvement Shannon Hess Fixed None Not Specified Attachments: esjava 18 KR logs.txt esjava 19 KR logs.txt esjava 28 HRE deadlock logs.txt esjava 29 HRE deadlock logs.txt reload_action_list_patch.txt Issue Links: Relate relates to KULRICE-4037 KFS user preference records cause bat... Closed Similar issues: KULRICE-4280 1.0.3.2, 2.0 Public (Public: Anyone can view) Priority: Assignee: Votes: Critical Peter Giles (Inactive) 0 Not Specified Not Specified RELOAD_ACTION_LIST user options not getting deleted on first load of Action List KULRICE-7588 Implement maintenance Delete action KULRICE-6849 Use of kewNonTransactionalDataSource is a problematic implementation for Action List cache handling KULRICE-8300 problems with implementation of super user tab KULRICE-13828 nexus-pref KULRICE-13077 Investigate Implementing Super User Screen KULRICE-5057 improved user experience after clicking a workflow action KULRICE-8225 Saved Document Search Improvements - ability to delete just one and ability to publish searches to individuals, groups, and roles KULRICE-3672 Rice Module: Application Requirement: KAI Review Status: KTI Review Status: Need to improve the way Rice handles remote applications when they are not accessible. KEW Rice Not Required Not Required Description At IU, The Solution in to delete RELOAD_ACTION_LIST prefs for the user on each saveRefreshUserOption 10% of the time is causing deadlocks. We have seen two deadlocks in production since we upgraded to Kuali Rice 1.0.3 four days ago. In addition, we are seeing row lock contention from the DELETE FROM KREW_USR_OPTN_T WHERE (PRNCPL_ID = :1) AND PRSN_OPTN_ID LIKE :2 statement. Having a better solution for the increased RELOAD_ACTION_LIST rows on this table is needed to prevent the deadlocks and contention. Please see for more information. Thanks, Shannon Comments Comment by Shannon Hess [ 03/Mar/11 ] Attaching logs from IU. The deadlock occurred at 7:14 PM. Comment by Shannon Hess [ 03/Mar/11 ] Text from DBAs * o + 2011-03-02 19:14:14.532 + ACTION NAME) 2011-03-02 19:14:14.532 + MODULE NAME:(JDBC Thin Client) 2011-03-02 19:14:14.532 + SERVICE NAME:(SYS$USERS) 2011-03-02 19:14:14.532 + SESSION ID2341.1617) 2011-03-02 19:14:14.532 DEADLOCK DETECTED ( ORA-00060 ) [Transaction Deadlock] The following deadlock is not an ORACLE error. It is a deadlock due to user error in the design of an application or from issuing incorrect ad-hoc SQL. The following information may aid in determining the deadlock: Deadlock graph: ------------- -------------Resource Name process session holds waits process session holds waits TX-00260017-0000e58f 180 2341 X 247 2690 X TX-00280015-0000ece9 247 2690 X 180 2341 X session 2341: DID 0001-00B4-0001B575 session 2690: DID 0001-00F7-000092B0 session 2690: DID 0001-00F7-000092B0 session 2341: DID 0001-00B4-0001B575 Rows waited on: Session 2690: obj - rowid = 00010459 - AAAQRZAQAAAEVDtAAn (dictionary objn - 66649, file - 1024, block - 1134829, slot - 39) Session 2341: obj - rowid = 00010459 - AAAQRZAQAAADE3JAAz (dictionary objn - 66649, file - 1024, block - 806345, slot - 51) Information on the OTHER waiting sessions: Session 2690: pid=247 serial=4107 audsid=232741206 user: 67/KR_PROXY O/S info: user: hrprdj, term: unknown, ospid: 1234, machine: esjava29.uits.indiana.edu program: JDBC Thin Client application name: JDBC Thin Client, hash value=2546894660 Current SQL Statement: DELETE FROM KREW_USR_OPTN_T WHERE (PRNCPL_ID = :1) AND PRSN_OPTN_ID LIKE :2 End of information on OTHER waiting sessions. Current SQL statement for this session: DELETE FROM KREW_USR_OPTN_T WHERE (PRNCPL_ID = :1) AND PRSN_OPTN_ID LIKE :2 =================================================== END OF DEADLOCK DETAILS Comment by Peter Giles (Inactive) [ 03/Mar/11 ] I put together this patch to try to address the issue. The idea is to access the flag for reloading the action list outside the JTA transaction and with methods that are atomic at the DB level (set, checkAndClear). Only a single row is used per user. Comment by Peter Giles (Inactive) [ 16/Mar/11 ] Eric mentioned that IU might be able to pull in this patch in for testing. Shannon or Eric, is this still feasible? Comment by Peter Giles (Inactive) [ 16/Mar/11 ] I noticed a spurious change to UserOptionsDAOOjbImpl that made its way into the patch, pulled it out and reattached. Comment by Peter Giles (Inactive) [ 18/Mar/11 ] Applied patch to both 1.0.3.2 and 1.1 branches, but tweaked it slightly: 1. there was an error in KEWSpringBeans.xml, renamed bean reloadActionListDao to reloadActionListDAO. 2. removed unused member variable "random" in UserOptionsServiceImpl.java. Comment by Matthew Aynalem (Inactive) [ 24/Mar/11 ] We ran into this issue at USC during our testing w/ rice 1.0.3.1 . appears to cause all of the RELOAD_ACTION_LIST entries to be deleted each time the principle clicks on their action list from the GUI, making the previous logic of 10% deleting before insert no longer needed. We chose to do a conditional insert only if a RELOAD_ACTION_LIST doesn't already exist (We only need 1 since will delete them all). We then went ahead and deleted all RELOAD_ACTION_LIST entries from the DB (when users click the action list the first time they will query the database anyways), and inserted entries for system users that don't typically click their action list (one-time thing, not part of application code). – goes w/ logic introduced in usc rice for conditionally inserting into KREW_USR_OPTN_T delete from KREW_USR_OPTN_T where PRSN_OPTN_ID like 'RELOAD_ACTION_LIST%'; – generate default entries for known system users (kr, kfs, admin) to prevent future inserts insert into krew_usr_optn_t (PRNCPL_ID,PRSN_OPTN_ID,VAL,VER_NBR) values ('1','RELOAD_ACTION_LIST1','true','1'); insert into krew_usr_optn_t (PRNCPL_ID,PRSN_OPTN_ID,VAL,VER_NBR) values ('2','RELOAD_ACTION_LIST1','true','1'); insert into krew_usr_optn_t (PRNCPL_ID,PRSN_OPTN_ID,VAL,VER_NBR) values ('3','RELOAD_ACTION_LIST1','true','1'); USC is willing to supply patch if RICE team is interested. Comment by Jessica Coltrin (Inactive) [ 04/May/11 ] Looks like this is fixed already by Peter for 1.0.3.2 so we are good to close. Comment by Jessica Coltrin (Inactive) [ 09/Sep/11 ] closing since 1.0.3.2 is released. Generated at Sun Mar 06 01:26:58 CST 2016 using JIRA 6.1.5#6160sha1:a61a0fc278117a0da0ec9b89167b8f29b6afdab2.