Package org.olat.properties

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


    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

              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

    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

      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

    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

      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

      // 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();
    } catch (Exception ex) {
      db.closeSession();
    }
View Full Code Here

      // no persistent lock acquired yet
      // save a property: cat = o_lock, key = derivedLockString, Longvalue = key
      // of identity acquiring the lock
      Property newp = pm.createPropertyInstance(null, null, null, CATEGORY_PERSISTENTLOCK, derivedLockString, null, ident.getKey(), null,
          null);
      pm.saveProperty(newp);
      aqTime = System.currentTimeMillis();
      lockOwner = ident;
      success = true;
    } else {
      // already acquired, but check on reaquiring
View Full Code Here

     */
    PropertyManager pm = PropertyManager.getInstance();
    Property p = pm.findProperty(null, null, null, "_o3_", "InfoMsg");
    if (p == null) {
      p =  pm.createPropertyInstance(null,  null,  null,  "_o3_", "InfoMsg", null, null, null, InfoMessageManager.EMPTY_MESSAGE);
      pm.saveProperty(p);
    }
    /*
     * ensure that the GlobalStickyMessage is initialized and registered to listen
     * -> OLAT-4168
     */
 
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.