Creating an Initial Context in the Persistence Service

The initial context is the starting point for all naming operations. In BI Beans, the initial context for the persistence service is an InitialPersistenceManager. The InitialPersistenceManager represents the root folder in the BI Beans Catalog where Persistable components can be saved.

How to create an initial context

To create an initial context, you construct the hash table of environment properties and then construct a new InitialPersistenceManager, passing the hash table as an argument to the constructor.

Example: How to create an initial context

The following example creates an initial context for an application that uses the default storage manager.


// create the hash table and set environment properties // session is the BISession object Hashtable persistenceEnvironment = new Hashtable(); persistenceEnvironment.put(PSRConstants.Login.USER_NAME, "REL2"); persistenceEnvironment.put(PSRConstants.Login.PASSWORD, "REL2"); persistenceEnvironment.put(PSRConstants.Login.SERVICE, "SJ816SUN"); persistenceEnvironment.put(PSRConstants.BISESSION, session); //create initial context InitialPersistenceManager pmRoot = null; try{    pmroot = new InitialPersistenceManager(persistenceEnvironment); } catch (NamingException ne){   ne.printStackTrace(); }