disabling remoting calls untill further investigation
authorCherian Mathew <c.mathew@bgbm.org>
Tue, 25 Feb 2014 08:03:44 +0000 (08:03 +0000)
committerCherian Mathew <c.mathew@bgbm.org>
Tue, 25 Feb 2014 08:03:44 +0000 (08:03 +0000)
eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/hibernate/collection/internal/AbstractPersistentCollection.java
eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/hibernate/proxy/AbstractLazyInitializer.java

index 44d62da34e42162bf4f78f664f56984f6b694f3d..ed2f23a14292e89567c4e0111c287ea79fe2c088 100644 (file)
@@ -552,21 +552,25 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
         * @throws LazyInitializationException if we cannot initialize
         */
        protected final void initialize(final boolean writing) {
+               // FIXME:Remoting is it true that session is null => we are in remoting mode
+//             if(session == null) {
+//                     remoteInitialize();
+//             }
+               
                if ( initialized ) {
                        return;
                }
-               // Adding remote call
-               remoteInitialize();
+
                
-//             withTemporarySessionIfNeeded(
-//                             new LazyInitializationWork<Object>() {
-//                                     @Override
-//                                     public Object doWork() {
-//                                             session.initializeCollection( AbstractPersistentCollection.this, writing );
-//                                             return null;
-//                                     }
-//                             }
-//             );
+               withTemporarySessionIfNeeded(
+                               new LazyInitializationWork<Object>() {
+                                       @Override
+                                       public Object doWork() {
+                                               session.initializeCollection( AbstractPersistentCollection.this, writing );
+                                               return null;
+                                       }
+                               }
+               );
        }
 
        private void throwLazyInitializationExceptionIfNotConnected() {
@@ -1194,7 +1198,7 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
        
        private void remoteInitialize() {
                
-               if (getOwner() != null && !wasInitialized()) {                  
+               if (getOwner() != null && !initialized) {                       
                        
                        try {
                                String role = getRole();
index 57d166b254bd0e32e68fbff3eeab0cca71df2f00..2881be5c3716bdbcc7cd597ef871207394a5e203 100644 (file)
@@ -165,9 +165,10 @@ public abstract class AbstractLazyInitializer implements LazyInitializer {
 
        @Override
        public final void initialize() throws HibernateException {
-               if( !initialized) {
-                       remoteInitialize();
-               }
+               // FIXME:Remoting is it true that session is null => we are in remoting mode
+//             if(session == null) {
+//                     remoteInitialize();
+//             }
                if ( !initialized ) {
                        if ( specjLazyLoad ) {
                                specialSpecjInitialization();
@@ -429,7 +430,7 @@ public abstract class AbstractLazyInitializer implements LazyInitializer {
        
        private void remoteInitialize() {               
                
-               if(isUninitialized()) {                         
+               if(!initialized) {                              
                        int classid = ((Integer)getIdentifier()).intValue();
                        System.out.print("--> Remote Lazy Initializing" + getEntityName() + " with id " + classid);
                        Class clazz;