Package com.webobjects.eocontrol

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


    /**
     * create a new editing context and work on the object there
     * to prevent you app from trying to touch the same object.
     */
    EOEditingContext ec = ERXEC.newEditingContext();
    ec.lock();
    try {

//      EOEnterpriseObject theObject = ec.faultForGlobalID( theObjectGID, ec);
     
      EOEnterpriseObject theObjectToPDF = EOUtilities.localInstanceOfObject(ec, myObject);
View Full Code Here


          long length;
          String queryString = url.queryString();
          boolean proxyAsAttachment = (queryString != null && queryString.contains("attachment=true"));

          EOEditingContext editingContext = ERXEC.newEditingContext();
          editingContext.lock();

          try {
            ERAttachment attachment = fetchAttachmentFor(editingContext, requestedAttachmentID, requestedWebPath);
           
            if (_delegate != null && !_delegate.attachmentVisible(attachment, request, context)) {
View Full Code Here

     *            the attachment to upload
     */
    public void enqueue(T attachment) {
        EOEditingContext editingContext = attachment.editingContext();

        editingContext.lock();

        try {
            EOGlobalID attachmentID = editingContext.globalIDForObject(attachment);
            ERAttachmentQueueEntry<T> entry = new ERAttachmentQueueEntry<T>(attachment._pendingUploadFile(), attachmentID);

View Full Code Here

        if (uploadedFile != null && uploadedFile.exists()) {
            try {
                performUpload(editingContext, attachment, uploadedFile);

                editingContext.lock();

                try {
                    attachment.setAvailable(Boolean.TRUE);

                    editingContext.saveChanges();
View Full Code Here

      return ERCHelpText.clazz.helpTextForKey(session().defaultEditingContext(), key);
    }
   
    public WOComponent edit() {
         EOEditingContext ec = ERXEC.newEditingContext();
         ec.lock();
         try {
           ERCHelpText text = ERCHelpText.clazz.helpTextForKey(ec, key);
           if(text == null) {
             text = ERCHelpText.clazz.createAndInsertObject(ec);
             text.setKey(key);
View Full Code Here

            log.debug("Starting outgoing mail processing.");
        ERXFetchSpecificationBatchIterator iterator = ERCMailMessage.mailMessageClazz().batchIteratorForUnsentMessages();

        EOEditingContext ec = ERXEC.newEditingContext();
        iterator.setEditingContext(ec);
        ec.lock();
        try {
            iterator.batchCount();
        } finally {
            ec.unlock();
        }
View Full Code Here

            ec.unlock();
        }
        ec.dispose();
        while (iterator.hasNextBatch()) {
            EOEditingContext temp = ERXEC.newEditingContext();
            temp.lock();
            try {
                iterator.setEditingContext(temp);
                sendMailMessages(iterator.nextBatch());
            } finally {
                temp.unlock();
View Full Code Here

     */
    public static EOEnterpriseObject actor(EOEditingContext ec) {
        EOEnterpriseObject actor = actor();
        if (actor != null && actor.editingContext() != ec) {
            EOEditingContext actorEc = actor.editingContext();
            actorEc.lock();
            try {
              EOEnterpriseObject localActor = ERXEOControlUtilities.localInstanceOfObject(ec, actor);
              try {
                if(actor instanceof ERCoreUserInterface) {
                  NSArray prefs = ((ERCoreUserInterface)actor).preferences();
View Full Code Here

                    standardExceptionPage.setException(exception);
                    standardExceptionPage.setActor(actor());
                    standardExceptionPage.setExtraInfo(extraInfo);

                    EOEditingContext ec = ERXEC.newEditingContext();
                    ec.lock();
                    try {
                        String shortExceptionName;
                        Throwable exceptionForTitle = exception;
                        if (exception instanceof InvocationTargetException) {
                            exceptionForTitle = ((InvocationTargetException)exception).getTargetException();
View Full Code Here

        assertEquals(dict, parsedDict);
    }

    public void testEOWithAttributesFilterToJSON() {
        EOEditingContext editingContext = ERXEC.newEditingContext(_osc);
        editingContext.lock();
        try {
            Person p = Person.createPerson(editingContext, "Mike");
            assertEquals("{\"type\":\"Person\",\"age\":null,\"name\":\"Mike\",\"salary\":null}\n", ERXRestFormat.json().toString(p, ERXKeyFilter.filterWithAttributes()));
        }
        finally {
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.