Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOEditingContext.unlock()


                ERXFetchSpecificationBatchIterator iterator = new ERXFetchSpecificationBatchIterator(fs);
                iterator.setEditingContext(ec);
                while(iterator.hasNextBatch()) {
                    NSArray objects = iterator.nextBatch();
                    if(iterator.currentBatchIndex() % treshhold == 0) {
                        ec.unlock();
                        // ec.dispose();
                        ec = ERXEC.newEditingContext();
                        ec.lock();
                        iterator.setEditingContext(ec);
                    }
View Full Code Here


                        ERIndex index = (ERIndex) i.nextElement();
                        index.addObjectsToIndex(ec, objects);
                    }
                }
            } finally {
                ec.unlock();
            }
            log.info("Indexing " + entity.name() + " took: " + (System.currentTimeMillis() - start) + " ms");
        }
    }
View Full Code Here

                ERXFetchSpecificationBatchIterator iterator = new ERXFetchSpecificationBatchIterator(fs);
                iterator.setEditingContext(ec);
                while (iterator.hasNextBatch()) {
                    NSArray objects = iterator.nextBatch();
                    if (iterator.currentBatchIndex() % treshhold == 0) {
                        ec.unlock();
                        // ec.dispose();
                        ec = ERXEC.newEditingContext();
                        ec.lock();
                        iterator.setEditingContext(ec);
                    }
View Full Code Here

                    NSArray<Document> documents = addedDocumentsForObjects(objects);
                    Transaction transaction = new Transaction(ec);
                    handler().addObjectsToIndex(transaction, objects);
                }
            } finally {
                ec.unlock();
            }
            log.info("Indexing " + entityName + " took: " + (System.currentTimeMillis() - start) + " ms");
        }
    }
View Full Code Here

      EOEditingContext editingContext = ERXEC.newEditingContext();
      try {
        person.localInstanceIn(editingContext).setEmailDeliveryFailure(Boolean.TRUE);
        editingContext.saveChanges();
      } finally {
        editingContext.unlock();
      }
      editingContext.dispose();
      SPUtilities.log.error("Failed to send email to '" + person.emailAddress() + "'.", e);
      errorNoticeList.addNotice("Failed to send email: " + e.getMessage());
    }
View Full Code Here

                        ec.setSharedEditingContext(null);
                        EOEnterpriseObject object = EOUtilities.localInstanceOfObject(ec, _object);
                        ec.deleteObject(object);
                        ec.saveChanges();
                    } finally {
                        ec.unlock();
                        ec.dispose();
                    }
                } else {
                  //Place the EO into a nested ec and try to delete there
                  //to prevent the appearance of a successful delete if
View Full Code Here

              pkValue = new NSData(((EOTemporaryGlobalID) gid)._rawBytes());
            }
          }
        }
        finally {
          editingContext.unlock();
        }
      }
      else {
        pkValue = ERXEOControlUtilities.primaryKeyObjectForObject(eo);
      }
View Full Code Here

    try {
      EOGlobalID gid = ERXEOControlUtilities.globalIDForString(editingContext, entity.entityName(), strPKValue);
      return editingContext.faultForGlobalID(gid, editingContext);
    }
    finally {
      editingContext.unlock();
    }
  }
}
View Full Code Here

                    database.recordSnapshotForGlobalID(snapshot, globalID);
                    dbContext.unlock();
                }
            }
        }
        ec.unlock();
    }

    // ENHANCEME: The subscriber could be processing the last destributed notification
    //            when it's requested to terminate. Should wait *here* for the last
    //            notification to finish, then return so that the coordinator can safely
View Full Code Here

                    ec.lock();
                    try {
                        _indexDirectory = ERIDirectory.clazz.directoryForName(ec, _store);
                    } finally {
                        ec.unlock();
                    }
                }
            } catch (IOException e) {
                throw NSForwardException._runtimeExceptionForThrowable(e);
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.