Package com.webobjects.eocontrol

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


        log.info("Received: " + n);
    }
   
    private void testIndexing() {
        EOEditingContext ec = ERXEC.newEditingContext();
        ec.lock();
        try {
            Tag tag = Tag.clazz.allObjects(ec).lastObject();
            Asset asset = Asset.clazz.allObjects(ec).lastObject();
            AssetGroup assetGroup = AssetGroup.clazz.allObjects(ec).lastObject();
            // new DataCreator().createDummyData();
View Full Code Here


    Format wholeNumberFormatter = new DecimalFormat("#,##0");
   
    long startTime = System.currentTimeMillis();
   
    EOEditingContext ec = newEditingContext();
    ec.lock();
    try {
      // Array for monitoring completed tasks to ensure normal completion
      NSMutableArray<Future<?>> childFutures = new NSMutableArray<Future<?>>();
      // Create the new TaskInfo
      TaskInfo taskInfo = ERXEOControlUtilities.createAndInsertObject(ec, TaskInfo.class);
View Full Code Here

    }

    @Override
    public void _run() {
      EOEditingContext ec = newEditingContext();
      ec.lock();
      try {
        log.info("Started child in " + Thread.currentThread().getName() + " with OSC " + ec.parentObjectStore());
       
        TaskInfo taskInfo = (TaskInfo) ec.faultForGlobalID(_childTaskInfoGID, ec);
       
View Full Code Here

   
    long startTime = System.currentTimeMillis();
   
    // Create an EC and lock/try/finally/unlock.
    EOEditingContext ec = ERXEC.newEditingContext();
    ec.lock();
    try {
      //
      TaskInfo taskInfo = (TaskInfo)ERXEOGlobalIDUtilities.fetchObjectWithGlobalID(ec, taskGID);

      // Loop for a period of time
View Full Code Here

    if (!_isStopped) {
      // We create an ec just for the sake of the constructor API on
      // T06EOFFactorialUpdateTask
      EOEditingContext ec = newEditingContext();
      ec.lock();
      try {
        TaskInfo taskInfo = (TaskInfo) ec.faultForGlobalID(_taskInfoGID, ec);
        _task2 = new T06EOFFactorialUpdateTask(taskInfo);
      } finally {
        ec.unlock();
View Full Code Here

      _taskInfoGID = future.get();
     
      // Finally, overwrite the startTime and Duration to reflect this combo task
      // rather than the last task.
      ec = newEditingContext();
      ec.lock();
      try {
        TaskInfo taskInfo = (TaskInfo) ec.faultForGlobalID(_taskInfoGID, ec);
        taskInfo.setStartTime(new NSTimestamp(startTime));
        taskInfo.setDuration(Long.valueOf(taskInfo.endTime().getTime() - startTime));
        ec.saveChanges();
View Full Code Here

   
    long startTime = System.currentTimeMillis();
   
    // Note we use the superclass convenience method here.
    EOEditingContext ec = newEditingContext();
    ec.lock();
    try {
      // Fetch the TaskInfo
      TaskInfo taskInfo = (TaskInfo) ec.faultForGlobalID(_taskInfoGID, ec);
      _totalCount = taskInfo.countResultItems().longValue();
     
View Full Code Here

       
        // Swap in a fresh EC for the next batch to help with memory management
        EOEditingContext freshEC = newEditingContext();
        ec.unlock();
        ec = freshEC;
        freshEC.lock();
       
        fsIterator.setEditingContext(ec);
       
        // We need to refault taskInfo into the new EC after swapping
        taskInfo = (TaskInfo) ec.faultForGlobalID(_taskInfoGID, ec);
View Full Code Here

          } else {
            throw ex;
          }
      } finally {
        if( shouldRevert ) {
          ec.lock();
          try {
            ec.revert();
          } finally {
            ec.unlock();
          }
View Full Code Here

    String where = "where eoentity_name = '" + entityName + "'";
    if(false) {
      // AK: this should actually be the correct way...
      EOEditingContext ec = ERXEC.newEditingContext();
      ec.lock();
      try {
        EODatabaseContext dbc = ERXEOAccessUtilities.databaseContextForEntityNamed((EOObjectStoreCoordinator) ec.rootObjectStore(), entityName);
        dbc.lock();
        try {
          EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, entityName);
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.