Package com.webobjects.eocontrol

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


      IERXMigration migration = migrationsIter.next();
      ERXModelVersion modelVersion = migrations.get(migration);
      EOModel model = modelVersion.model();
      IERXMigrationLock migrationLock = databaseLockForModel(model);
      EOEditingContext editingContext = newEditingContext();
      editingContext.lock();
      try {
        ERXMigrationAction migrationAction = new ERXMigrationAction(editingContext, migration, modelVersion, migrationLock, _lockOwnerName, postMigrations);
        try {
          ERXSQLHelper helper = ERXSQLHelper.newSQLHelper(model);
          try {
View Full Code Here


    Iterator<IERXPostMigration> postMigrationsIter = postMigrations.keySet().iterator();
    while (postMigrationsIter.hasNext()) {
      IERXPostMigration postMigration = postMigrationsIter.next();
      ERXModelVersion modelVersion = postMigrations.get(postMigration);
      EOEditingContext editingContext = newEditingContext();
      editingContext.lock();
      try {
        try {
          if (ERXMigrator.log.isInfoEnabled()) {
            ERXMigrator.log.info("Running post migration for " + modelVersion.model().name() + " version " + modelVersion.version() + " ...");
          }
View Full Code Here

   *         tables
   */
  @SuppressWarnings("unchecked")
  public String createSchemaSQLForEntitiesInModelAndOptions(NSArray<EOEntity> entities, EOModel model, NSDictionary optionsCreate) {
    EOEditingContext ec = ERXEC.newEditingContext();
    ec.lock();
    try {
      EODatabaseContext databaseContext = databaseContextForModel(model, (EOObjectStoreCoordinator) ec.rootObjectStore());
      // AK the default implementation loads the shared objects, and when
      // they don't exist, throw an an error
      // which is not very useful for schema generation
View Full Code Here

       this(entityNameForClass(c));
    }
   
    protected static String entityNameForClass(Class c) {
      EOEditingContext ec = ERXEC.newEditingContext();
      ec.lock();
      try {
        EOEntity entity = EOUtilities.entityForClass(ec, c);
        if(entity != null) {
          return entity.name();
        }
View Full Code Here

  public void execute(final JobExecutionContext jobexecutioncontext) throws JobExecutionException
  {
    super.execute(jobexecutioncontext);
   
    EOEditingContext ec = editingContext();
    ec.lock();
    try
    {
      NSArray<? extends ERQSJobDescription> jobs2Check = getSchedulerFPInstance().getListOfJobDescription(ec);
      setResultMessage("# of jobs to check: " + jobs2Check.size());
      if (log.isDebugEnabled())
View Full Code Here

        // We save in database if there is no exception.
        if (id != null && jobexecutionexception == null)
        {
          userInfo.setObjectForKey(id, ERQSJob.ENTERPRISE_OBJECT_KEY);
          EOEditingContext ec = editingContext();
          ec.lock();
          try
          {
            // aJobDescription eo is refreshed because it can have been modified by the job.
            // The job can use a different EOF stack so this ec doesn't know that it has changed.
            // If we don't refresh it, we could get a updateValuesInRowDescribedByQualifier exception.
View Full Code Here

      else {
        ec.undoManager().setLevelsOfUndo(levelsOfUndo < 0 ? 10 : levelsOfUndo);
      }
      setDefaultDelegateOnEditingContext(ec, validationEnabled);
      if (!useSharedEditingContext()) {
        ec.lock();
        ec.setSharedEditingContext(null);
        ec.unlock();
      }
      NSNotificationCenter.defaultCenter().postNotification(EditingContextDidCreateNotification, ec);
      if(objectStore instanceof ERXEC) {
View Full Code Here


    public WOComponent returnHat(WOComponent sender) {
        Framework framework = (Framework) object(sender);
        EOEditingContext peer = ERXEC.newEditingContext();
        peer.lock();
        try {
            framework = (Framework) framework.localInstanceIn(peer);
            framework.releaseHat();
            peer.saveChanges();
        } finally {
View Full Code Here

     * we run over all people in the DB and send them a summary email if they
     * have unread bugs
     */
    public void runBatchReport() {
        EOEditingContext ec = ERXEC.newEditingContext();
        ec.lock();
        try {
            NSArray everybody = People.clazz.allObjects(ec);
            for (Enumeration e = everybody.objectEnumerator(); e.hasMoreElements();) {
                People person = (People) e.nextElement();
                NSDictionary bindings = new NSDictionary(new Object[] { person }, new Object[] { "user" });
View Full Code Here

  public static class SimpleFetchTest extends ThrashTest {
    @Override
    protected void _run() {
      EOEditingContext ec = editingContext();
      ec.lock();
      NSArray rows = EOUtilities.objectsForEntityNamed(ec, "Employee");
      ec.unlock();
      print("RESULT", "row count = " + rows.count());
    }
  }
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.