code: protected Session getWriteSession()
  	{
  		final Session session = getSession();
  
  		if (session.isDefaultReadOnly())
  		{
  			throw new ReadOnlyTransactionException("Cannot perform write operation on " + clazz + " in a read-only transaction");
  		}
  		else
  		{
  			return session;
  		}
  	}
docs: Get a session and confirm that it is permitted to perform write operations<br />
  
  @return
  
  @throws ReadOnlyTransactionException
  if we cannot perform writes in this session