Package com.orientechnologies.orient.test.io

Source Code of com.orientechnologies.orient.test.io.MassiveConnectDisconnectTest

package com.orientechnologies.orient.test.io;

import org.testng.annotations.Test;

import com.orientechnologies.orient.core.config.OGlobalConfiguration;
import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;
import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery;

@Test
public class MassiveConnectDisconnectTest {

  public static void main(String[] args) {
    OGlobalConfiguration.STORAGE_KEEP_OPEN.setValue(false);

    final ODatabaseDocumentTx db = new ODatabaseDocumentTx("remote:localhost/demo");
    for (int i = 0; i < 1000; ++i) {
      System.out.println("Connecting " + i + "...");
      db.open("admin", "admin");
      db.query(new OSQLSynchQuery<Object>("select 1"));
//      try {
//        Thread.sleep(100);
//      } catch (InterruptedException e) {
//        e.printStackTrace();
//      }
      db.close();
    }
  }

}
TOP

Related Classes of com.orientechnologies.orient.test.io.MassiveConnectDisconnectTest

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.