public void testModifyCmrCollectionOusideTx() throws Exception {
resetDB();
beginTransaction();
Set songs;
SongLocal newSong;
try {
ArtistLocal artist = findArtist(new Integer(1));
newSong = createSong(new Integer(33));
songs = artist.getComposed();
} finally {
completeTransaction();
}
// CMR collections should still be readable
assertFalse(songs.isEmpty());
assertEquals(2, songs.size());
for (Iterator iter = songs.iterator(); iter.hasNext();) {
SongLocal song = (SongLocal) iter.next();
if (song.getId().equals(new Integer(11))) {
assertEquals("value11", song.getName());
} else if (song.getId().equals(new Integer(22))) {
assertEquals("value22", song.getName());
} else {
fail();
}
}