t = s.beginTransaction();
Criteria criteria = s.createCriteria( Student.class ).setReadOnly( true );
assertFalse( s.isDefaultReadOnly() );
assertTrue( criteria.isReadOnlyInitialized() );
assertTrue( criteria.isReadOnly() );
gavin = ( Student ) criteria.uniqueResult();
assertFalse( s.isDefaultReadOnly() );
assertTrue( criteria.isReadOnlyInitialized() );
assertTrue( criteria.isReadOnly() );
assertTrue( s.isReadOnly( gavin ) );
assertFalse( Hibernate.isInitialized( gavin.getPreferredCourse() ) );