Package com.opengamma.util.db

Examples of com.opengamma.util.db.DbConnector$HibernateTransactionTemplate


//    }
//  }

  //-------------------------------------------------------------------------
  public void test_clock() {
    DbConnector dbConnector = getDbConnector();
    List<Instant> instants1 = Lists.newArrayList();
    int[] times = new int[50000];
    for (int i = 0; i < times.length; i++) {
      instants1.add(dbConnector.now());
    }
    List<Instant> instants2 = new ArrayList<>(instants1);
    Collections.sort(instants2);
    assertEquals(instants1, instants2);
  }
View Full Code Here


    DbTool dbTool = _dbTool;
    if (dbTool == null) {
      synchronized (this) {
        dbTool = _dbTool;
        if (dbTool == null) {
          DbConnector connector = s_connectors.get(Pair.<String, Class<?>>of(_databaseType, dbConnectorScope()));
          _dbTool = dbTool = DbTest.createDbTool(_databaseType, connector)// CSIGNORE
        }
      }
    }
    return dbTool;
View Full Code Here

  }

  private DbConnector initConnector() {
    Class<?> scope = dbConnectorScope();
    Pair<String, Class<?>> key = Pair.<String, Class<?>>of(_databaseType, scope);
    DbConnector connector = s_connectors.get(key);
    if (connector == null) {
      synchronized (this) {
        connector = s_connectors.get(key);
        if (connector == null) {
          DbDialect dbDialect = DbDialectUtils.getSupportedDbDialect(getDatabaseType());
View Full Code Here

    DbDialect dialect = createDialect();
    NamedParameterJdbcTemplate jdbcTemplate = new NamedParameterJdbcTemplate(getDataSource());
    SessionFactory hibernateSessionFactory = createHibernateSessionFactory(dialect);
    HibernateTemplate hibernateTemplate = createHibernateTemplate(hibernateSessionFactory);
    TransactionTemplate transactionTemplate = createTransactionTemplate(hibernateSessionFactory);
    DbConnector dbConnector = new DbConnector(getName(), dialect, getDataSource(), jdbcTemplate, hibernateTemplate, transactionTemplate);
   
    ComponentInfo info = new ComponentInfo(DbConnector.class, getClassifier());
    repo.registerComponent(info, dbConnector);
    return dbConnector;
  }
View Full Code Here

TOP

Related Classes of com.opengamma.util.db.DbConnector$HibernateTransactionTemplate

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.