import org.jboss.logging.Logger;
import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteConfiguration;
+import eu.etaxonomy.cdm.cache.ProxyUtils;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.taxeditor.remoting.CdmEagerLoadingException;
-import eu.etaxonomy.taxeditor.remoting.cache.ProxyUtils;
import eu.etaxonomy.taxeditor.service.ICachedCommonService;
/**
* Base class implementing {@link org.hibernate.collection.spi.PersistentCollection}
*
- * This a extended copy of the original class from hibernate. It has been extended to
+ * This is an extended copy of the original class from hibernate. It has been extended to
* allow making remote service calls to spring httpinvoker services (see section at the bottom
* of this class).
*
- *
* @author Gavin King
* @author Cherian Mathew
*/
* The correct <code>serialVersionUID</code> is the <code>stream classdesc serialVersionUID</code>
* from the error message.
*/
- private static final long serialVersionUID = 2742261122392386159L;
+ private static final long serialVersionUID = 7094296207968006972L;
private transient SessionImplementor session;
private boolean initialized;
this.owner = owner;
}
- /** ------ Below is section of code which makes remote service calls ----- */
+/** ####################################################################
+
+ ADDED PART: Below is section of code which makes remote service calls
+
+ #################################################################### */
+
+
// The affected methods are :
// initialize(final boolean writing)
// readSize()
configuration = conf;
}
-
private void remoteInitialize() {
if (getOwner() != null && !initialized) {
throw new HibernateException("commonService not initialized (null)");
}
- //Object obj = ProxyUtils.deproxy(cachedCommonService.initializeCollection(this));
- Object obj = ProxyUtils.deproxy(cachedCommonService.initializeCollection(cdmBase.getUuid(), fieldName));
- if(ProxyUtils.isProxy(obj)) {
+ //Object obj = ProxyUtils.deproxyIfInitialized(cachedCommonService.initializeCollection(this));
+ Object obj = ProxyUtils.deproxyIfInitialized(cachedCommonService.initializeCollection(cdmBase.getUuid(), fieldName));
+ if(ProxyUtils.isUninitializedProxy(obj)) {
throw new HibernateException("Persistent Collection initialized but is still a proxy");
}
afterInitialize();
}
}
}
-
-
-
-}
-
+}
\ No newline at end of file