Package eu.curia.suivi2.datamanager

Examples of eu.curia.suivi2.datamanager.Updater


  @SuppressWarnings("boxing")
  public void action() throws DataAccessException {
    String name = "UpdaterNoWait:" + Thread.currentThread().getId() + ":";

    // Extract developer information
    Developer d = this.dbDao.readDeveloperById(DEVELOPER_ID);
    // Modify object info
    d.setNameDeveloper(name);
    d.getIdDeveloperLevel().setLabelLevel("MIDDLE_" + name);
    // Update info
    this.dbDao.updateDeveloper(d);
    System.out.println("==============================");
    System.out.printf("THREAD ID        : %s\n", name);
    System.out.printf("DEV LOCK VERS ID : %s\n", d.getOptimisticLockId());
    System.out.printf("DEV ID           : %s\n", d.getIdDeveloper());
    System.out.printf("DEV NAME         : %s\n", d.getNameDeveloper());
    System.out.printf("DEV LEVEL        : %s\n", d.getIdDeveloperLevel()
        .getLabelLevel());
    System.out.printf("LEV LOCK VERS ID : %s\n", d.getIdDeveloperLevel()
        .getOptimisticLockId());
    System.out.println("==============================");

  }
View Full Code Here


  @SuppressWarnings("boxing")
  public void action() throws DataAccessException, InterruptedException {
    int delay = 10000;
    String name = "UpdaterWithWait:" + Thread.currentThread().getId() + ":";
    // Extract developer information
    Developer d = this.dbDao.readDeveloperById(DEVELOPER_ID);
    System.out.println("==============================");
    System.out.printf("THREAD ID        : %s\n", name);
    System.out.printf("DEV LOCK VERS ID : %s\n", d.getOptimisticLockId());
    System.out.printf("DEV ID           : %s\n", d.getIdDeveloper());
    System.out.printf("DEV NAME         : %s\n", d.getNameDeveloper());
    System.out.printf("DEV LEVEL        : %s\n", d.getIdDeveloperLevel()
        .getLabelLevel());
    System.out.printf("LEV LOCK VERS ID : %s\n", d.getIdDeveloperLevel()
        .getOptimisticLockId());
    System.out.printf("--> Data readed, wait %s seconds !!!!\n",
        (delay / 1000));
    System.out.println("==============================");
    // Wait 5 seconds
    Thread.sleep(delay);
    // Modify object info
    d.setNameDeveloper(name);
    d.getIdDeveloperLevel().setLabelLevel("MIDDLE_" + name);
    // Update info
    this.dbDao.updateDeveloper(d);
    System.out.println("==============================");
    System.out.printf("THREAD ID        : %s\n", name);
    System.out.printf("DEV LOCK VERS ID : %s\n", d.getOptimisticLockId());
    System.out.printf("DEV ID           : %s\n", d.getIdDeveloper());
    System.out.printf("DEV NAME         : %s\n", d.getNameDeveloper());
    System.out.printf("DEV LEVEL        : %s\n", d.getIdDeveloperLevel()
        .getLabelLevel());
    System.out.printf("LEV LOCK VERS ID : %s\n", d.getIdDeveloperLevel()
        .getOptimisticLockId());
    System.out.println("==============================");

  }
View Full Code Here

    String name = "ReaderNoLock_" + DATE_FORMATTER.format(new Date());
    try {
      System.out.println("==============================");
      System.out.printf("THREAD ID : %s\n", name);
      // Extract and display developer information
      Developer d = this.dbDao.readDeveloperById(DEVELOPER_ID);
      System.out.printf("DEV ID    : %s\n", d.getIdDeveloper());
      System.out.printf("DEV NAME  : %s\n", d.getNameDeveloper());
      System.out.printf("DEV LEVEL : %s\n", d.getIdDeveloperLevel()
          .getLabelLevel());
    } catch (TopLinkJdbcException tplje) {
      System.out.printf("THREAD ID : %s --> Enregistement lock� !!!\n",
          name);
    } catch (Exception e) {
View Full Code Here

  public void action() {
    int delay = 5000;
    String name = "Updater_" + DATE_FORMATTER.format(new Date());
    try {
      // Extract developer information
      Developer d = this.dbDao.readAndLockDeveloperById(DEVELOPER_ID);
      System.out.println("==============================");
      System.out.printf("THREAD ID : %s\n", name);
      System.out.printf("DEV ID    : %s\n", d.getIdDeveloper());
      System.out.printf("DEV NAME  : %s\n", d.getNameDeveloper());
      System.out.printf("DEV LEVEL : %s\n", d.getIdDeveloperLevel()
          .getLabelLevel());
      System.out.printf(
          "--> Data readed and locked, wait %s seconds !!!!\n",
          (delay / 1000));
      System.out.println("==============================");
      // Wait 5 seconds
      Thread.sleep(delay);
      // Modify object info
      d.setNameDeveloper(name);
      d.getIdDeveloperLevel().setLabelLevel("MIDDLE_" + name);
      // Update info
      this.dbDao.updateDeveloper(d);
      System.out.println("==============================");
      System.out.printf("THREAD ID : %s\n", name);
      System.out.printf("DEV ID    : %s\n", d.getIdDeveloper());
      System.out.printf("DEV NAME  : %s\n", d.getNameDeveloper());
      System.out.printf("DEV LEVEL : %s\n", d.getIdDeveloperLevel()
          .getLabelLevel());
      System.out.println("--> Data updated !!!!");
    } catch (TopLinkJdbcException tplje) {
      System.out.printf("THREAD ID : %s --> Enregistement lock� !!!\n",
          name);
View Full Code Here

    String name = "ReaderLock_" + DATE_FORMATTER.format(new Date());
    try {
      System.out.println("==============================");
      System.out.printf("THREAD ID : %s\n", name);
      // Extract and display developer information
      Developer d = this.dbDao.readAndLockDeveloperById(DEVELOPER_ID);
      System.out.printf("DEV ID    : %s\n", d.getIdDeveloper());
      System.out.printf("DEV NAME  : %s\n", d.getNameDeveloper());
      System.out.printf("DEV LEVEL : %s\n", d.getIdDeveloperLevel()
          .getLabelLevel());
    } catch (TopLinkJdbcException tplje) {
      System.out.printf("THREAD ID : %s --> Enregistement lock� !!!\n",
          name);
    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of eu.curia.suivi2.datamanager.Updater

Copyright © 2018 www.massapicom. 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.