Examples of saveProperty()


Examples of org.olat.properties.PropertyManager.saveProperty()

    PropertyManager pm = PropertyManager.getInstance();
    Property p1 = pm.createPropertyInstance(null, null, null, propertyCategory, propertyKey1, null, null, "doTestNonTransactionalError_1", null);
    pm.saveProperty(p1);
    // name is null => generated DB error => no rollback of p1
    Property p2 = pm.createPropertyInstance(null, null, null, propertyCategory, null, null, null, "doTestNonTransactionalError_2", null);
    pm.saveProperty(p2);
    getWindowControl().setError("Should generate error for rollback!");
    Tracing.logError("Should generate error and not reach this code",getClass());
  }

  private void doTestTransactionalError() {
View Full Code Here

Examples of org.olat.properties.PropertyManager.saveProperty()

  private void doTestTransactionalError() {
    DB db = DBFactory.getInstance();
    PropertyManager pm = PropertyManager.getInstance();
    Property p1 = pm.createPropertyInstance(null, null, null, propertyCategory, propertyKey1, null, null, "doTestTransactionalError_1", null);
    pm.saveProperty(p1);
    // name is null => generated DB error => rollback
    Property p2 = pm.createPropertyInstance(null, null, null, propertyCategory, null, null, null, "doTestTransactionalError_2", null);
    pm.saveProperty(p2);
    getWindowControl().setError("Should generate error for rollback!");
    Tracing.logError("Should generate error for rollback and not reach this code",getClass());
View Full Code Here

Examples of org.olat.properties.PropertyManager.saveProperty()

    PropertyManager pm = PropertyManager.getInstance();
    Property p1 = pm.createPropertyInstance(null, null, null, propertyCategory, propertyKey1, null, null, "doTestTransactionalError_1", null);
    pm.saveProperty(p1);
    // name is null => generated DB error => rollback
    Property p2 = pm.createPropertyInstance(null, null, null, propertyCategory, null, null, null, "doTestTransactionalError_2", null);
    pm.saveProperty(p2);
    getWindowControl().setError("Should generate error for rollback!");
    Tracing.logError("Should generate error for rollback and not reach this code",getClass());
  }
 
  private void doTestMixTransactionalError() {
View Full Code Here

Examples of org.olat.properties.PropertyManager.saveProperty()

 
  private void doTestMixTransactionalError() {
    DB db = DBFactory.getInstance();
    PropertyManager pm = PropertyManager.getInstance();
    Property p1 = pm.createPropertyInstance(null, null, null, propertyCategory, propertyKey1, null, null, "doTestMixTransactional_1", null);
    pm.saveProperty(p1);
    // name is null => generated DB error => rollback
    Property p2 = pm.createPropertyInstance(null, null, null, propertyCategory, null, null, null, "doTestMixTransactional_2", null);
    pm.saveProperty(p2);
    getWindowControl().setError("Should generate error for rollback!");
    Tracing.logError("Should generate error for rollback and not reach this code",getClass());
View Full Code Here

Examples of org.olat.properties.PropertyManager.saveProperty()

    PropertyManager pm = PropertyManager.getInstance();
    Property p1 = pm.createPropertyInstance(null, null, null, propertyCategory, propertyKey1, null, null, "doTestMixTransactional_1", null);
    pm.saveProperty(p1);
    // name is null => generated DB error => rollback
    Property p2 = pm.createPropertyInstance(null, null, null, propertyCategory, null, null, null, "doTestMixTransactional_2", null);
    pm.saveProperty(p2);
    getWindowControl().setError("Should generate error for rollback!");
    Tracing.logError("Should generate error for rollback and not reach this code",getClass());
  }

  private void doReset() {
View Full Code Here

Examples of org.olat.properties.PropertyManager.saveProperty()

              PropertyManager pm = PropertyManager.getInstance();
              Property p = pm.findProperty(null, null, null, PROPERTY_CATEGORY, PROPERTY_NAME);
              if (p == null) {
                // wow first time ever, save current date
                p = pm.createPropertyInstance(null, null, null, PROPERTY_CATEGORY, PROPERTY_NAME, null, null, null, null);
                pm.saveProperty(p);
              }
              comicStartDate = p.getCreationDate().getTime();
            }
           
          });
View Full Code Here

Examples of org.olat.properties.PropertyManager.saveProperty()

    String propertyKey = "testRollback-1";
    String testValue = "testRollback-1";
    try {
      PropertyManager pm = PropertyManager.getInstance();
      Property p1 = pm.createPropertyInstance(null, null, null, null, propertyKey, null, null, testValue, null);
      pm.saveProperty(p1);
      String propertyKey2 = "testRollback-2";
      String testValue2 = "testRollback-2";
      // name is null => generated DB error => rollback
      Property p2 = pm.createPropertyInstance(null, null, null, null, null, null, null, testValue2, null);
      pm.saveProperty(p2);
View Full Code Here

Examples of org.olat.properties.PropertyManager.saveProperty()

      pm.saveProperty(p1);
      String propertyKey2 = "testRollback-2";
      String testValue2 = "testRollback-2";
      // name is null => generated DB error => rollback
      Property p2 = pm.createPropertyInstance(null, null, null, null, null, null, null, testValue2, null);
      pm.saveProperty(p2);
      fail("Should generate error for rollback.");
    } catch (Exception ex) {
      db.closeSession();
    }
    // check if p1 is rollbacked
View Full Code Here

Examples of org.olat.properties.PropertyManager.saveProperty()

    String testValue3 = "testMixed-3";
    try {
      // outside of transaction
      PropertyManager pm = PropertyManager.getInstance();
      Property p1 = pm.createPropertyInstance(null, null, null, null, propertyKey1, null, null, testValue1, null);
      pm.saveProperty(p1);
      // inside of transaction
      Property p2 = pm.createPropertyInstance(null, null, null, null, propertyKey2, null, null, testValue2, null);
      pm.saveProperty(p2);
      // name is null => generated DB error => rollback
      Property p3 = pm.createPropertyInstance(null, null, null, null, null, null, null, testValue3, null);
View Full Code Here

Examples of org.olat.properties.PropertyManager.saveProperty()

      PropertyManager pm = PropertyManager.getInstance();
      Property p1 = pm.createPropertyInstance(null, null, null, null, propertyKey1, null, null, testValue1, null);
      pm.saveProperty(p1);
      // inside of transaction
      Property p2 = pm.createPropertyInstance(null, null, null, null, propertyKey2, null, null, testValue2, null);
      pm.saveProperty(p2);
      // name is null => generated DB error => rollback
      Property p3 = pm.createPropertyInstance(null, null, null, null, null, null, null, testValue3, null);
      pm.saveProperty(p3);
      fail("Should generate error for rollback.");
      db.closeSession();
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.