A big anti-pattern in Adobe Experience Manager is sharing sessions between threads. Besides other problems, it. can. slow. down. repository. read. and. writes. Shared sessions can be the source of memory leaks as well. Or, if a developer is combating memory leaks aggressively, a session can be closed while a thread is using it. Sessions take many forms. Pass a Resource, a Node, or a ResourceResolver between threads and a session has been shared. Services may unknowingly share sessions with threads. When passing a session to a service, a developer needs to be aware of that possibility.
Jörg Hoh came out with a helpful blog post about this. It makes a much larger impact on scaling within Apache Jackrabbit Oak (AEM 6+) than Apache Jackrabbit 2 (AEM/CQ5) because of structural changes within Oak to improve performance. He has some information about places where problems may not be expected. Better yet, he has examples of what to do (and what not to do).
This anti-pattern comes into play easily. I answered two queries about this from two different people yesterday in the space of five minutes. This concept counts as a Must Understand for AEM developers.
CQDump/Things on a content management system: AEM scaling patterns: Avoid shared sessions