Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

JCR Sessions and multi threading

jakej40603950
Level 5
Level 5

As per this document, when dealing with multiple threads we'd have to create one session for each thread:

 

https://cqdump.wordpress.com/2013/11/25/cq-development-anti-pattern-single-session-multiple-threads/

 

Does this still apply with the latest JackRabbit Oak used in 6.3 and above?

1 Accepted Solution
Jörg_Hoh
Correct answer by
Employee
Employee

Yes, this still applies.

View solution in original post

6 Replies
jakej40603950
Level 5
Level 5

Thanks. There's still nothing about shared sessions there.

 

Found this link:

https://cqdump.wordpress.com/2015/03/02/aem-scaling-patterns-avoid-shared-sessions/

 

And as pointed out there, it does give the exception related to concurrent use of a session when I try to use the same session with multiple threads. 

In that case, it's supposed to serialize the thread access but weirdly the time taken with shared sessions and with separate sessions and multiple threads are very similar. Hmm...

 

@Jörg_Hoh  : Any thoughts?

jakej40603950
Level 5
Level 5
Thank you so much. What was your 2nd answer in response to? 🙂
Jörg_Hoh
Correct answer by
Employee
Employee

Yes, this still applies.

View solution in original post