NumberedNode root = new NumberedNode( "root" );
NumberedNode child = new NumberedNode( "child" );
NumberedNode grandchild = new NumberedNode( "grandchild" );
root.addChild( child );
child.addChild( grandchild );
s.saveOrUpdate( root );
s = applyNonFlushedChangesToNewSessionCloseOldSession( s );
root = ( NumberedNode ) getOldToNewEntityRefMap().get( root );
child = ( NumberedNode ) getOldToNewEntityRefMap().get( child );
grandchild = ( NumberedNode ) getOldToNewEntityRefMap().get( grandchild );
SimpleJtaTransactionManagerImpl.getInstance().commit();