int id = ((KnowledgeBaseImpl) this.kbase).nextWorkingMemoryCounter();
RuleBaseConfiguration conf = ((KnowledgeBaseImpl) this.kbase).getConfiguration();
StatefulKnowledgeSessionImpl session = ProtobufInputMarshaller.readSession( context,
id,
environment,
<BUG>(SessionConfiguration) config );

context.close();</BUG>
if ( ((SessionConfiguration) config).isKeepReference() ) {
((KnowledgeBaseImpl) this.kbase).addStatefulSession(session);

int id = ((KnowledgeBaseImpl) this.kbase).nextWorkingMemoryCounter();
RuleBaseConfiguration conf = ((KnowledgeBaseImpl) this.kbase).getConfiguration();
StatefulKnowledgeSessionImpl session = ProtobufInputMarshaller.readSession( context,
id,
environment,
(SessionConfiguration) config,
initializer );
context.close();
if ( ((SessionConfiguration) config).isKeepReference() ) {
((KnowledgeBaseImpl) this.kbase).addStatefulSession(session);
