4.3.1.21 SessionFactory

4.3.1.21.1 Synopsis
4.3.1.21.2 close()
4.3.1.21.3 getConnectionPoolSessionCounts()
4.3.1.21.4 getSession()
4.3.1.21.5 getSession(Map)

SessionFactory represents a cluster.

4.3.1.21.1 Synopsis
 public interface SessionFactory {
// Public Methods  public abstract void close();
  public abstract List<Integer> getConnectionPoolSessionCounts();
  public abstract Session getSession();
  public abstract Session getSession(Map properties);
}

Figure 4.20 SessionFactory Class

SessionFactory Class

4.3.1.21.2 close()
public abstract void close();

Close this session factory. Release all resources.

4.3.1.21.3 getConnectionPoolSessionCounts()
public abstract List<Integer> getConnectionPoolSessionCounts();

Get a list containing the number of open sessions for each connection in the connection pool.

Since

7.3.14, 7.4.12, 7.5.2

4.3.1.21.4 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.21.5 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