Code example for SessionException

0
		UnresolvableObjectException.throwIfNull( result, id, persister.getEntityName() ); 
	} 
 
	public Object immediateLoad(String entityName, Serializable id) 
			throws HibernateException { 
		throw new SessionException("proxies cannot be fetched by a stateless session"); 
	} 
 
	public void initializeCollection( 
			PersistentCollection collection, 
	        boolean writing) throws HibernateException { 
		throw new SessionException("collections cannot be fetched by a stateless session"); 
	} 
 
	public Object instantiate( 
			String entityName, 
	        Serializable id) throws HibernateException { 
		errorIfClosed(); 
		return getFactory().getEntityPersister( entityName ) 
				.instantiate( id, this );