4.3.1.20 SessionFactory

4.3.1.20.1 Synopsis
4.3.1.20.2 close()
4.3.1.20.3 getSession()
4.3.1.20.4 getSession(Map)

SessionFactory represents a cluster.

4.3.1.20.1 Synopsis
 public interface SessionFactory {
// Public Methods  public abstract void close();
  public abstract Session getSession();
  public abstract Session getSession(Map properties);
}

Figure 4.19 SessionFactory Class

SessionFactory Class

4.3.1.20.2 close()
public abstract void close();

Close this session factory. Release all resources.

4.3.1.20.3 getSession()
public abstract Session getSession();

Create a Session to use with the cluster, using all the properties of the SessionFactory.

Parameters

return

the session

4.3.1.20.4 getSession(Map)
public abstract Session getSession(Map properties);

Create a session to use with the cluster, overriding some properties. Properties PROPERTY_CLUSTER_CONNECTSTRING, PROPERTY_CLUSTER_DATABASE, and PROPERTY_CLUSTER_MAX_TRANSACTIONS may not be overridden.

Parameters

properties

overriding some properties for this session

return

the session