if ( session == this.session ) {
return false;
}
else {
if ( isConnectedToSession() ) {
final CollectionEntry ce = session.getPersistenceContext().getCollectionEntry( this );
if ( ce == null ) {
throw new HibernateException(
"Illegal attempt to associate a collection with two open sessions"
);
}
else {
throw new HibernateException(
"Illegal attempt to associate a collection with two open sessions: " +
MessageHelper.collectionInfoString(
ce.getLoadedPersister(), this,
ce.getLoadedKey(), session
)
);
}
}
else {