当前位置: 首页>>代码示例>>Java>>正文


Java ODatabaseDocumentTx.open方法代码示例

本文整理汇总了Java中com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.open方法的典型用法代码示例。如果您正苦于以下问题:Java ODatabaseDocumentTx.open方法的具体用法?Java ODatabaseDocumentTx.open怎么用?Java ODatabaseDocumentTx.open使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx的用法示例。


在下文中一共展示了ODatabaseDocumentTx.open方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: makeActive

import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; //导入方法依赖的package包/类
public void makeActive() {
    makeActiveDb();

    if (this.connectionFailed) {
        this.connectionFailed = false;

        try {
            if (this.pool != null) {
                this.pool.reCreatePool();
                this.database = this.pool.acquire();
            } else {
                ODatabaseDocumentTx replaceDb = new ODatabaseDocumentTx(this.database.getURL());
                replaceDb.open(user, password);
                this.database = replaceDb;
            }
            makeActiveDb();
        } catch (OException e) {
            OLogManager.instance().info(this, "Recreation of connection resulted in exception", e);
        }
    }
}
 
开发者ID:orientechnologies,项目名称:orientdb-gremlin,代码行数:22,代码来源:OrientGraph.java

示例2: connect

import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; //导入方法依赖的package包/类
public OrientConnection connect() throws Exception {
    final OrientGraphFactory graphFactory = new OrientGraphFactory(url.toString(), userName, password);

    final ODatabaseDocumentTx database = graphFactory.getDatabase(false, false);
    if (database.exists()) {
        database.open(userName, password);
        database.drop();
    }

    graphFactory.setAutoStartTx(false);
    graphFactory.declareIntent(new OIntentMassiveInsert().setEnableCache(false));

    return new AbstractOrientConnection(graphFactory.getNoTx()) {
        @Override
        public void close() throws Exception {
            graph.commit();
            graph.getRawGraph().close();
        }
    };
}
 
开发者ID:gsson,项目名称:dependency-grapher,代码行数:21,代码来源:OrientDB.java

示例3: getDatabase

import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; //导入方法依赖的package包/类
private ODatabaseDocumentTx getDatabase(String url, String userName, String password)
{
    ODatabaseDocumentTx tx = new ODatabaseDocumentTx(url);
    if (!tx.exists())
    {
        tx.create();
        return tx;
    }
    return tx.open(userName, password);
}
 
开发者ID:geekflow,项目名称:light,代码行数:11,代码来源:OtherTest.java

示例4: connect

import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; //导入方法依赖的package包/类
@Override
public ODatabaseDocumentTx connect(final String name, final boolean create) {
  checkNotNull(name);
  ensureStarted();

  String uri = connectionUri(name);
  ODatabaseDocumentTx db = new ODatabaseDocumentTx(uri);

  if (db.exists()) {
    db.open(SYSTEM_USER, SYSTEM_PASSWORD);
    log.debug("Opened database: {} -> {}", name, db);
  }
  else {
    if (create) {
      db.create();
      log.debug("Created database: {} -> {}", name, db);

      // invoke created callback
      try {
        created(db, name);
      }
      catch (Exception e) {
        Throwables.throwIfUnchecked(e);
        throw new RuntimeException(e);
      }
    }
    else {
      log.debug("Database does not exist: {}", name);
    }
  }

  return db;
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:34,代码来源:DatabaseManagerSupport.java

示例5: getDatabase

import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; //导入方法依赖的package包/类
/**
 * @param create
 *            if true automatically creates database if database with given
 *            URL does not exist
 * @param open
 *            if true automatically opens the database
 */
protected ODatabaseDocumentTx getDatabase(boolean create, boolean open) {
    final ODatabaseDocumentTx db = new ODatabaseDocumentTx(url);
    if (!db.getURL().startsWith("remote:") && !db.exists()) {
        if (create)
            db.create();
        else if (open) throw new ODatabaseException("Database '" + url + "' not found");
    } else if (open) db.open(user, password);

    return db;
}
 
开发者ID:orientechnologies,项目名称:orientdb-gremlin,代码行数:18,代码来源:OrientGraphFactory.java

示例6: create

import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; //导入方法依赖的package包/类
@Override
public ODatabaseDocumentTx create() throws Exception {
	ODatabaseDocumentTx db = new ODatabaseDocumentTx(dbURL);
	if (exists(db)) {
		db.open("admin", "admin");
	}
	db.declareIntent(currentMode == Mode.NO_TX_MODE ? new OIntentMassiveInsert() : new OIntentMassiveRead());
	allConns.add(db);
	return db;
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:11,代码来源:OrientDatabase.java

示例7: TestOrientDBAppender

import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; //导入方法依赖的package包/类
public TestOrientDBAppender(){
	PropertyConfigurator.configure(LOG4J_PROPS);
	
	
	appender=(OrientDBAppender) log.getRootLogger().getAppender("OrientDB");
	
	database = new ODatabaseDocumentTx("remote:" + DB_HOSTNAME + ":" + DB_PORT + "/" + DB_DATABASE_NAME);
	database.open(DB_USER_NAME, DB_PASSWORD);
	ODatabaseRecordThreadLocal.INSTANCE.set(database);
}
 
开发者ID:zahidMed,项目名称:log4j-database,代码行数:11,代码来源:TestOrientDBAppender.java


注:本文中的com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.open方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。