Code example for SessionException

0
		if ( session == null ) {
			throw new TransientObjectException(
					"Proxy is detached (i.e, session is null). The read-only/modifiable setting is only accessible when the proxy is associated with an open session." ); 
		} 
		if ( session.isClosed() ) {
			throw new SessionException(
					"Session is closed. The read-only/modifiable setting is only accessible when the proxy is associated with an open session." ); 
		} 
	} 
 
	@Override 
	public final boolean isReadOnly() { 
		errorIfReadOnlySettingNotAvailable(); 
		return readOnly;
	} 
 
	@Override 
	public final void setReadOnly(boolean readOnly) {
		errorIfReadOnlySettingNotAvailable(); 
		// only update if readOnly is different from current setting 
Stop searching for code, let great code find you!  Add Codota to your java IDE