Environment env = KnowledgeBaseFactory.newEnvironment();
env.set( EnvironmentName.ENTITY_MANAGER_FACTORY,
emf );
env.set( EnvironmentName.TRANSACTION_MANAGER,
TransactionManagerServices.getTransactionManager() );
env.set( EnvironmentName.GLOBALS, new MapGlobalResolver() );
StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession( kbase, null, env );
// EntityManager em = emf.createEntityManager();
// SessionInfo sInfo = em.find( SessionInfo.class, 1 );