Information Technology Reference
In-Depth Information
sistentProcessTest class by creating the JPAReadAndWriteStrategy object
and adding it to the corresponding environment variable:
Environment environment = kservices.newEnvironment();
...
environment.set(EnvironmentName.OBJECT_MARSHALLING_STRATEGIES,
new ObjectMarshallingStrategy[] {
new JPAReadAndWriteStrategy(emf),
new SerializablePlaceholderResolverStrategy(
ClassObjectarshallingStrategyAcceptor.DEFAULT)
});
This configuration works by providing an array of the ObjectMar-
shallingStrategy objects, and the engine will try to find the first strategy in the
provided array that accepts each specific object and uses it to persist or read the corres-
pondent objects. This configuration needs to be the same when restoring a specific KIE
session; otherwise, you might get marshalling problems.
Search WWH ::




Custom Search