Policy Documention Eclipse, PDP-D, Sess Pers
[policy/engine.git] / docs / platform / feature_sesspersist.rst
1
2 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
3 .. http://creativecommons.org/licenses/by/4.0
4
5 ************************************
6 Feature: Session Persistence
7 ************************************
8
9 The session persistence feature allows drools kie sessions to be persisted in a database surviving pdp-d restarts.
10
11     .. code-block:: bash
12        :caption: Enable session persistence
13        :linenos:
14
15         policy stop
16         features enable session-persistence
17
18 The configuration is located at:
19
20     -  *$POLICY_HOME/config/feature-session-persistence.properties*
21
22 Each controller that wants to be started with persistence should contain the following line in its *<controller-name>-controller.properties*
23
24     -  *persistence.type=auto*
25
26     .. code-block:: bash
27        :caption: Start the PDP-D using session-persistence
28        :linenos:
29
30         db-migrator -o upgrade -s ALL
31         policy start
32
33 Facts will survive PDP-D restart using the native drools capabilities and introduce a performance overhead.
34
35     .. code-block:: bash
36        :caption: Disable the session-persistence feature
37        :linenos:
38
39         policy stop
40         features disable session-persistence
41         sed -i "/persistence.type=auto/d" <controller-name>-controller.properties 
42         db-migrator -o erase -s sessionpersistence   # delete all its database data (optional)
43         policy start
44
45 End of Document
46
47 .. SSNote: Wiki page ref. https://wiki.onap.org/display/DW/Feature+Session+Persistence
48
49