jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1513485 - /jackrabbit/oak/trunk/oak-doc/src/site/markdown/dos_and_donts.md
Date Tue, 13 Aug 2013 13:44:29 GMT
Author: jukka
Date: Tue Aug 13 13:44:29 2013
New Revision: 1513485

URL: http://svn.apache.org/r1513485
OAK-301: Document Oak

Notes on session refresh behavior


Modified: jackrabbit/oak/trunk/oak-doc/src/site/markdown/dos_and_donts.md
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-doc/src/site/markdown/dos_and_donts.md?rev=1513485&r1=1513484&r2=1513485&view=diff
--- jackrabbit/oak/trunk/oak-doc/src/site/markdown/dos_and_donts.md (original)
+++ jackrabbit/oak/trunk/oak-doc/src/site/markdown/dos_and_donts.md Tue Aug 13 13:44:29 2013
@@ -20,4 +20,25 @@ TODO Document patterns and anti patterns
 * Observation
 * Session live time, explicit refresh
 * Use admin session
-* ...
\ No newline at end of file
+* ...
+## Session refresh behavior
+Oak is based on the MVCC model where each session starts with a snapshot
+view of the repository. Concurrent changes from other sessions *are not
+visible* to a session until it gets refreshed. A session can be refreshed
+either explicitly by calling the ``refresh()`` method or implicitly by
+direct-to-workspace methods or by the auto-refresh mode. Also observation
+event delivery causes a session to be refreshed.
+By default the auto-refresh mode automatically refreshes all sessions that
+have been idle for more than one second, and it's also possible to
+explicitly set the auto-refresh parameters. A typical approach would be
+for long-lived admin sessions to set the auto-refresh mode to keep the
+session always up to date with latest changes from the repository.
+### Pattern: One session for one request/operation
+One of the key patterns targeted by Oak is a web application that serves
+HTTP requests. The recommended way to handle such cases is to use a
+separate session for each HTTP request, and never to refresh that session.

View raw message