Package com.webobjects.eocontrol

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


                editingContext.lock();

                try {
                    attachment.setAvailable(Boolean.TRUE);

                    editingContext.saveChanges();
                } finally {
                    editingContext.unlock();
                }

                if (_processor.delegate() != null) {
View Full Code Here


                                                                      null,
                                                                      WOApplication.application().name() + ": " + shortExceptionName
                                                                      + ": " + exceptionForTitle.getMessage(),
                                                                      standardExceptionPage.generateResponse().contentString(),
                                                                      ec);
                        ec.saveChanges();
                    } finally {
                        ec.unlock();
                    }
                    ec.dispose();
                }
View Full Code Here

        editingContext.lock();
        try {
            Person p = Person.createPerson(editingContext, "Mike");
            Company c = Company.createCompany(editingContext, "Company");
            p.setCompanyRelationship(c);
            editingContext.saveChanges();

            ERXRestFormat.json().parse("{\"name\":\"Mike Updated\",\"company\":{\"name\":\"Company Updated\"}}").updateObjectWithFilter(p, ERXKeyFilter.filterWithAllRecursive(), new ERXRestContext(editingContext));
            assertEquals("Mike Updated", p.name());
            assertNotSame(c, p.company());
            assertNotNull(p.company());
View Full Code Here

                pref.takeValueForKey(encodedValue(value),"value");
                if (log.isDebugEnabled())
                    log.debug("Creating preference "+u+": "+key+" - "+value+" -- "+encodedValue(value));
            }
            if (ec.hasChanges()) {
                ec.saveChanges();
            }
        } catch(RuntimeException ex) {
          log.error("Error while setting preference " + key +  ": " + ex);
        } finally {
            ec.unlock();
View Full Code Here

        try {
          if (ERXMigrator.log.isInfoEnabled()) {
            ERXMigrator.log.info("Running post migration for " + modelVersion.model().name() + " version " + modelVersion.version() + " ...");
          }
          postMigration.postUpgrade(editingContext, modelVersion.model());
          editingContext.saveChanges();
        }
        catch (Throwable t) {
          throw new ERXMigrationFailedException("Failed on post migrations for model '" + modelVersion.model().name() + "'.", t);
       
      }
View Full Code Here

              log.debug("method: jobWasExecuted: aJobDescription: " + aJobDescription);

            if (aJobDescription != null && aJobDescription.isEnterpriseObject())
            {
              updateJobDescription(jobexecutioncontext, aJobDescription);
              ec.saveChanges();
            }
          }  catch (NSValidation.ValidationException eValidation)
          {
            errorMsg = eValidation.getMessage();
            userInfo.setObjectForKey(eValidation, EXCEPTION_KEY);
View Full Code Here

    EOEditingContext ec = ERXEC.newEditingContext();
    ERSessionInfo info = ERSessionInfo.clazz.objectMatchingKeyAndValue(ec, ERSessionInfo.SESSION_ID_KEY, s);
    if(info != null) {
      WOSession session = info.session();
      info.delete();
      ec.saveChanges();
      return session;
    }
    return null;
  }
View Full Code Here

      if(!info.isNewObject()) {
        removeSessionWithID(session.sessionID());
      }
      return;
    }
    ec.saveChanges();
  }
 
}
View Full Code Here

        EOEditingContext peer = ERXEC.newEditingContext();
        peer.lock();
        try {
            framework = (Framework) framework.localInstanceIn(peer);
            framework.releaseHat();
            peer.saveChanges();
        } finally {
            peer.unlock();
        }

        return sender.context().page();
View Full Code Here

    public void testNestedECs() {
      try {
        EOEditingContext ec = ERXEC.newEditingContext();
        Company c = (Company) EOUtilities.createAndInsertInstance(ec, Company.ENTITY_NAME);
        c.setName("Name");
        ec.saveChanges();
        EOEditingContext nested = ERXEC.newEditingContext(ec);
        Company nestC = c.localInstanceIn(nested);
        Employee e = (Employee) EOUtilities.createAndInsertInstance(nested, Employee.ENTITY_NAME);
        e.setFirstName("First");
        e.setLastName("Last");
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.