I would go with solution number 2: one session per student. Given the fact that you are not going to be interacting too much with the session, I would keep it in a db and only restore it when needed: a new absence/incident arrives, the session for that student is restored from db, the facts are inserted, the rules are executed and the resulting status is retrieved.
The main disadvantage I see with this scenario is that creating rules about more than one student is not straightforward and you have to feed your facts to more than one session. For example, if you want rise an alert if you have more than 10 students with CRITICAL status in a single class. In this case, a session per class would be enough. So, as you can see, you have to decide what is better for you. But no matter the 'unit' you choose (school, class, student) I would still recommend you the execution flow I mentioned earlier.
Drools already comes with support for database persistence using JPA. You could get more information about this feature here: http://docs.jboss.org/drools/release/5.5.0.Final/drools-expert-docs/html_single/#d0e3961
The basic idea is that instead of creating your ksessions using kbase.newStatefulKnowledgeSession()
you use the helper class called JPAKnowledgeService
. This class will return a wrapper of a StatefulKnowledgeSession
that will persist its state after each method invocation. In this class you will find 2 important methods: newStatefulKnowledgeSession()
, to create a new ksession and loadStatefulKnowledgeSession()
to retrieve an existing session from the database.
Hope it helps,