Community commons release lock error

0
I use locks in my application. But sometimes (not always) I get this java error in my log files. Anybody an idear what causes this exception error? Jan 12 14:40:24 127.0.0.1 cataprod: INFO - Core: Login OK: user 'Mendix'. Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: Exception in scheduled event 'releaseOldLocks' Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (1/35) com.mendix.core.CoreException: Exception occurred in action 'Microflow [CommunityCommons.releaseOldLocksSE]', all database changes executed by this action were rolled back Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (2/35) at com.mendix.core.actionmanagement.CoreAction.d(SourceFile:553) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (3/35) Caused by: com.mendix.core.CoreException: Exception occurred in microflow 'CommunityCommons.releaseOldLocksSE' for activity 'Call 'releaseAllInactiveLocks'', all database changes executed by this microflow were rolled back Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (4/35) at kT.b(SourceFile:252) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (5/35) Caused by: com.mendix.core.CoreException: java.util.ConcurrentModificationException Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (6/35) at iw.b(SourceFile:167) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (7/35) Caused by: java.util.ConcurrentModificationException Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (8/35) at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (9/35) at java.util.HashMap$EntryIterator.next(HashMap.java:834) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (10/35) at java.util.HashMap$EntryIterator.next(HashMap.java:832) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (11/35) at communitycommons.ORM.releaseOldLocks(ORM.java:309) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (12/35) at communitycommons.actions.releaseAllInactiveLocks.executeAction(releaseAllInactiveLocks.java:29) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (13/35) at communitycommons.actions.releaseAllInactiveLocks.executeAction(releaseAllInactiveLocks.java:18) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (14/35) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:49) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (15/35) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:473) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (16/35) at iw.b(SourceFile:155) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (17/35) at com.mendix.core.Core.execute(SourceFile:191) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (18/35) at hl.a(SourceFile:70) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (19/35) at kT.a(SourceFile:67) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (20/35) at eU.executeAction(SourceFile:96) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (21/35) at com.mendix.systemwideinterfaces.core.UserAction.execute(SourceFile:49) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (22/35) at com.mendix.core.actionmanagement.CoreAction.call(SourceFile:473) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (23/35) at iw.b(SourceFile:155) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (24/35) at com.mendix.core.Core.execute(SourceFile:191) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (25/35) at F.a(SourceFile:104) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (26/35) at F.run(SourceFile:79) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (27/35) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (28/35) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (29/35) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (30/35) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (31/35) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (32/35) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (33/35) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (34/35) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) Jan 12 14:48:53 127.0.0.1 cataprod: ERROR - ActionManager: (35/35) at java.lang.Thread.run(Thread.java:662)
asked
1 answers
0

Its a bug, can you file a support ticket with that stacktrace?

UPDATE

Looked into the code, if you apply the following patch I expect the problem to be gone (not tested yet)

Replace the releaseOldLocks method at javasource/communitycommons/ORM.java line 313 with:

public synchronized static void releaseOldLocks()
{
    Set<ISession> activeSessions = new HashSet<ISession>(Core.getActiveSessions()); //Lookup with Ord(log(n)) instead of Ord(n).

    List<Long> tbrm = new ArrayList<Long>();
    for (Entry<Long, ISession> lock : locks.entrySet()) 
        if (!activeSessions.contains(lock.getValue()))
            tbrm.add(lock.getKey());

    for(Long key : tbrm)
        locks.remove(key);      
}
answered