Information Technology Reference
In-Depth Information
The preceding code section performs a series of steps needed to configure a persistent en-
vironment and load a KIE knowledge base. These components will be used while creating
(and further down the line, loading) a KIE session that is persisted in a JPA persistence
unit.
For brevity reasons, we skipped the creation of some of the components, such as the JPA
EntityManagerFactory object, and the initialization of TransactionManager ,
leaving only the code relevant for the configuration of the Environment variable. If
you want to see a full example of this code, it's available in the JPAPersistentPro-
cessTest.java file in the persistent-process-examples project.
You can see that we have set special entries in the environment variable for the entity
manager factory and transaction manager. These are the most basic properties a persistent
environment defined with JPA will need. Later on, the KIE components will use the speci-
fied environment to determine how the persistence is configured in your environment.
Also, we are defining the KIE knowledge base. This is because, as we mentioned earlier,
the persistence is only going to store minimal information for the runtime to be reloaded
in another context. For this reason, the persistence mechanisms don't have the trouble of
serializing the full knowledge base, and it must be provided each time we create or reload
a persistent KIE session.
Search WWH ::




Custom Search