Package com.webobjects.eocontrol

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


            assertEquals("Company", c.name());
            assertEquals(100.0, c.revenue().doubleValue());
            assertEquals(0, c.employees().count());
        }
        finally {
            editingContext.unlock();
            editingContext.dispose();
        }
    }

    public void testCreateEOAndRelatedEO() {
View Full Code Here


            assertEquals("Mike", p.name());
            assertEquals(10, p.age().intValue());
            assertEquals(null, p.salary());
        }
        finally {
            editingContext.unlock();
            editingContext.dispose();
        }
    }

    public void testUpdateEO() {
View Full Code Here

            ERXRestFormat.json().parse("{\"name\":\"Company Updated\",\"revenue\":100}]}").updateObjectWithFilter(c, ERXKeyFilter.filterWithAll(), new ERXRestContext(editingContext));
            assertEquals("Company Updated", c.name());
            assertEquals(100.0, c.revenue().doubleValue());
        }
        finally {
            editingContext.unlock();
            editingContext.dispose();
        }
    }

    public void testUpdateAndCreateRelatedEO() {
View Full Code Here

            assertFalse(editingContext.deletedObjects().containsObject(c));
            assertTrue(editingContext.globalIDForObject(p.company()).isTemporary());
            assertEquals("Company Updated", p.company().name());
        }
        finally {
            editingContext.unlock();
            editingContext.dispose();
        }
    }

    public void testUpdateRelatedEO() {
View Full Code Here

            assertEquals("Mike Updated", p.name());
            assertSame(c, p.company());
            assertEquals("Company Updated", p.company().name());
        }
        finally {
            editingContext.unlock();
            editingContext.dispose();
        }
    }

    public void testSimpleParse() {
View Full Code Here

        } catch(JDBCAdaptorException ex) {
            if(!(ERXApplication.erxApplication() instanceof ERXMainRunner)) {
                throw ex;
            }
        } finally {
            ec.unlock();
        }
    }

    private static boolean _sharedDataInitialized = false;
   
View Full Code Here

                }
            }
        } catch(RuntimeException ex) {
          log.error("Error while getting preference " + key +  ": " + ex);
        } finally {
            ec.unlock();
        }
        ec.dispose();
        if (log.isDebugEnabled())
            log.debug("Prefs vfk " + key + " = " + result);
        return result;
View Full Code Here

                ec.saveChanges();
            }
        } catch(RuntimeException ex) {
          log.error("Error while setting preference " + key +  ": " + ex);
        } finally {
            ec.unlock();
        }
        ec.dispose();
        NSNotificationCenter.defaultCenter().postNotification(PreferenceDidChangeNotification,
                                                              new NSDictionary(value, key));
    }
View Full Code Here

            ec.lock();
            try {
                EOSharedEditingContext sec = (useSharedEditingContext()) ? _pool.sharedEditingContextForObjectStore(os) : null;
                ec.setSharedEditingContext(sec);
            } finally {
                ec.unlock();
            }
            return ec;
        }

        public boolean useSharedEditingContext() {
View Full Code Here

        catch (Throwable t) {
          throw new ERXMigrationFailedException("Failed to migrate model '" + model.name() + "'.", t);
        }       
      }
      finally {
        editingContext.unlock();
      }
    }

    Iterator<IERXPostMigration> postMigrationsIter = postMigrations.keySet().iterator();
    while (postMigrationsIter.hasNext()) {
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.