Connecting to memory DB by remote doesn't work with V3.0

Hello,

I work on a Java project using OrientDB since many years. We was using OrientDB V2.2.33 until now. We would like to upgrade to V3.0. We have hundreds unit tests using OrientDB. Theses tests create a DB in memory (using memory: in URL) and then connect to it by remote connection (using remote: in URL).
All of them work perfectly with version 2.2.33.
With version 3.0.27 (the last one actually), there is a problem at the connection. The DB creation in memory seems ok but there is no matter to connect to it by remote. We get this error:

Exception `2AC09448` in storage `plocal:/space/USERS/gouit/workspace/testV3/target/databases/MyDB`: 3.0.27 - Veloce (build e4e73e77074c4f49337ae58b171513cd10ac1157, branch UNKNOWN)
com.orientechnologies.orient.core.exception.OStorageException: Cannot open the storage 'MyDB' because it does not exist in path: /space/USERS/gouit/workspace/testV3/target/databases/MyDB
	at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.open(OAbstractPaginatedStorage.java:287)
	at com.orientechnologies.orient.core.db.OrientDBEmbedded.open(OrientDBEmbedded.java:283)
	at com.orientechnologies.orient.core.db.OrientDBEmbedded.open(OrientDBEmbedded.java:228)
	at com.orientechnologies.orient.server.OServer.openDatabase(OServer.java:939)
	at com.orientechnologies.orient.server.OServer.openDatabase(OServer.java:913)
	at com.orientechnologies.orient.server.OConnectionBinaryExecutor.executeDatabaseOpen37(OConnectionBinaryExecutor.java:1187)
	at com.orientechnologies.orient.client.remote.message.OOpen37Request.execute(OOpen37Request.java:77)
	at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.sessionRequest(ONetworkProtocolBinary.java:310)
	at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.execute(ONetworkProtocolBinary.java:212)
	at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:69)

I would like to know if it is a bug in V3.0 or if I do something wrong.
If it is a bug, is there any workaround or have we to wait for a next version to correct it ?
If I do something wrong, I would be gratefully if someone could help me to find the correct way to do it.

I implemented a small test which reproduces this problem:
src/test/java/test/V3Test.java:

package test;

import org.junit.Test;

import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal;
import com.orientechnologies.orient.core.metadata.schema.OClass;
import com.orientechnologies.orient.core.metadata.schema.OSchema;
import com.orientechnologies.orient.core.metadata.schema.OType;
import com.orientechnologies.orient.server.OServer;
import com.orientechnologies.orient.server.OServerMain;
import com.tinkerpop.blueprints.impls.orient.OrientBaseGraph;
import com.tinkerpop.blueprints.impls.orient.OrientGraphFactory;
import com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx;

public class V3Test {

    @Test
    public void test() throws Exception {
        // Initialize memory DB
        System.out.println("*** create embedded server ***");
        final OServer server = OServerMain.create();
        server.startup(getClass().getResourceAsStream("/embeddedOrientServer.xml"));
        server.activate();
        System.out.println(" *** ORIENT SERVER STARTED ***");

        System.out.println("*** create database schema ***");
        final String dbUrlMem = "memory:./target/databases/MyDB";
        OrientGraphNoTx graphDBNoTx = new OrientGraphNoTx(dbUrlMem);
        graphDBNoTx.drop();
        graphDBNoTx.shutdown();
        graphDBNoTx = new OrientGraphNoTx(dbUrlMem);
        final OSchema schema = graphDBNoTx.getRawGraph().getMetadata().getSchema();
        final OClass myClass = schema.createClass("MyClass", schema.getClass("V"));
        myClass.createProperty("MyAtt", OType.STRING);
        System.out.println("*** database schema successfully created ***");

        // Open remote connection on memory DB
        System.out.println("Use a pool for database connection with pool size " + 50);
        final String dbUrlRemote = "remote:localhost/MyDB";
        final OrientGraphFactory orientFactory = new OrientGraphFactory(dbUrlRemote, "admin", "admin")
                .setupPool(1, 50);
        orientFactory.setAutoStartTx(false);

        final OrientBaseGraph orientBaseGraph = orientFactory.getNoTx();
        ODatabaseRecordThreadLocal.instance().set(orientBaseGraph.getRawGraph());

        // Create vertex
        orientBaseGraph.addVertex("class:MyClass", new Object[] { "MyAtt", "MyAttValue" });

        // Close DB
        orientBaseGraph.getRawGraph().close();
        server.shutdown();
    }
}

When I run it with version 2.2.33, all work:

*** create embedded server ***

2020-02-07 11:05:42:684 INFO  Loading configuration from input stream
2020-02-07 11:05:42:777 INFO  OrientDB Server v2.2.33 (build 77584cd6827f647cf4aa231cf27bd6f10bc04e2c, branch 2.2.x) is starting up...
2020-02-07 11:05:42:780 INFO  Databases directory: /space/USERS/gouit/workspace/testV3/target/databases
2020-02-07 11:05:42:801 INFO  Configuration of usage of soft references inside of containers of results of SQL execution
2020-02-07 11:05:42:802 INFO  Initial or maximum values of heap memory usage are NOT set, containers of results of SQL executors will NOT use soft references by default
2020-02-07 11:05:42:802 INFO  Auto configuration of disk cache size.
2020-02-07 11:05:42:803 INFO  Disk cache size is directly set by the user to the 512 mb
2020-02-07 11:05:42:846 WARNI The configured memory chunk size (2147483647 bytes) is larger than the configured maximum cache size (536870912 bytes). That may cause overallocation of a memory which will be wasted, please tune the configuration up. Use the storage.diskCache.bufferSize OrientDB option to raise the cache memory size or memory.chunk.size OrientDB option to lower memory chunk size.
2020-02-07 11:05:42:848 INFO  Lowering memory chunk size from 2,147,483,647B to 536,870,912B.
2020-02-07 11:05:42:874 INFO  {db=OSystem} Creating the system database 'OSystem' for current server
2020-02-07 11:05:43:036 INFO  Storage 'plocal:/space/USERS/gouit/workspace/testV3/target/databases/OSystem' is created under OrientDB distribution : 2.2.33 (build 77584cd6827f647cf4aa231cf27bd6f10bc04e2c, branch 2.2.x)
2020-02-07 11:05:43:847 SEVER ODefaultServerSecurity.loadConfig() Could not access the security JSON file: /space/USERS/gouit/workspace/testV3/target/config/security.json
2020-02-07 11:05:43:935 INFO  Listening binary connections on 0.0.0.0:2424 (protocol v.36, socket=default)
2020-02-07 11:05:43:936 INFO  Listening http connections on 0.0.0.0:2480 (protocol v.10, socket=default)
2020-02-07 11:05:43:937 INFO  Found ORIENTDB_ROOT_PASSWORD variable, using this value as root's password
2020-02-07 11:05:43:940 WARNI onAfterDynamicPlugins() Configuration document is empty
2020-02-07 11:05:43:942 WARNI GREMLIN language not available (not in classpath)
2020-02-07 11:05:43:942 INFO  [OVariableParser.resolveVariables] Error on resolving property: distributed
2020-02-07 11:05:43:943 WARNI Authenticated clients can execute any kind of code into the server by using the following allowed languages: [sql]
2020-02-07 11:05:43:944 INFO  OrientDB Studio available at http://192.168.9.22:2480/studio/index.html
2020-02-07 11:05:43:944 INFO  OrientDB Server is active v2.2.33 (build 77584cd6827f647cf4aa231cf27bd6f10bc04e2c, branch 2.2.x). *** ORIENT SERVER STARTED ***
*** create database schema ***

2020-02-07 11:05:43:951 INFO  Storage 'memory:./target/databases/MyDB' is created under OrientDB distribution : 2.2.33 (build 77584cd6827f647cf4aa231cf27bd6f10bc04e2c, branch 2.2.x)
2020-02-07 11:05:44:250 INFO  Storage 'memory:./target/databases/MyDB' is created under OrientDB distribution : 2.2.33 (build 77584cd6827f647cf4aa231cf27bd6f10bc04e2c, branch 2.2.x)*** database schema successfully created ***
Use a pool for database connection with pool size 50

2020-02-07 11:05:44:644 INFO  OrientDB Server is shutting down...
2020-02-07 11:05:44:644 INFO  Shutting down listeners:
2020-02-07 11:05:44:644 INFO  - ONetworkProtocolBinary /0.0.0.0:2424:
2020-02-07 11:05:44:644 INFO  - ONetworkProtocolHttpDb /0.0.0.0:2480:
2020-02-07 11:05:44:644 INFO  Shutting down protocols
2020-02-07 11:05:44:645 INFO  Shutting down plugins:
2020-02-07 11:05:44:645 INFO  - script-interpreter
2020-02-07 11:05:44:645 INFO  - graph
2020-02-07 11:05:44:645 INFO  Shutting down databases:
2020-02-07 11:05:44:645 INFO  Orient Engine is shutting down...
2020-02-07 11:05:44:645 INFO  - shutdown storage: MyDB...
2020-02-07 11:05:44:646 INFO  - shutdown storage: MyDB...
2020-02-07 11:05:44:646 INFO  - shutdown storage: OSystem...
2020-02-07 11:05:44:782 INFO  OrientDB Engine shutdown complete
2020-02-07 11:05:44:783 INFO  OrientDB Server shutdown complete

When I run it with version 3.0.27, I get the exception:

*** create embedded server ***
Feb 07, 2020 10:49:22 AM com.orientechnologies.common.log.OLogManager log
INFO: Detected limit of amount of simultaneously open files is 4096,  limit of open files for disk cache will be set to 1536
Feb 07, 2020 10:49:22 AM com.orientechnologies.common.log.OLogManager log
WARNING: Value of limit of simultaneously open files is too small, recommended value is 262144

2020-02-07 10:49:22:409 INFO  Loading configuration from input stream [OServerConfigurationLoaderXml]
2020-02-07 10:49:22:502 INFO  OrientDB Server v3.0.27 - Veloce (build e4e73e77074c4f49337ae58b171513cd10ac1157, branch UNKNOWN) is starting up... [OServer]
2020-02-07 10:49:22:512 INFO  OrientDB config DISKCACHE=512MB [orientechnologies]
2020-02-07 10:49:22:534 INFO  System is started under an effective user : `gouit` [OEngineLocalPaginated]
2020-02-07 10:49:22:534 INFO  Allocation of 7782 pages. [OEngineLocalPaginated]
2020-02-07 10:49:22:551 INFO  Directory /space/USERS/gouit/workspace/testV3/target/databases does not exist, try to create it. [OrientDBEmbedded]
2020-02-07 10:49:22:557 INFO  WAL maximum segment size is set to 9,733 MB [OrientDBEmbedded]
2020-02-07 10:49:22:557 INFO  Databases directory: /space/USERS/gouit/workspace/testV3/target/databases [OServer]
2020-02-07 10:49:22:572 INFO  Creating the system database 'OSystem' for current server [OSystemDatabase]
2020-02-07 10:49:22:592 INFO  Direct IO for WAL located in /space/USERS/gouit/workspace/testV3/target/databases/OSystem is allowed with block size 4096 bytes. [OCASDiskWriteAheadLog]
2020-02-07 10:49:22:592 INFO  Page size for WAL located in /space/USERS/gouit/workspace/testV3/target/databases/OSystem is set to 4096 bytes. [OCASDiskWriteAheadLog]
2020-02-07 10:49:22:852 INFO  Storage 'plocal:/space/USERS/gouit/workspace/testV3/target/databases/OSystem' is created under OrientDB distribution : 3.0.27 - Veloce (build e4e73e77074c4f49337ae58b171513cd10ac1157, branch UNKNOWN) [OLocalPaginatedStorage]
2020-02-07 10:49:23:407 SEVER ODefaultServerSecurity.loadConfig() Could not access the security JSON file: /space/USERS/gouit/workspace/testV3/target/config/security.json [ODefaultServerSecurity]
2020-02-07 10:49:23:490 INFO  Listening binary connections on 0.0.0.0:2424 (protocol v.37, socket=default) [OServerNetworkListener]
2020-02-07 10:49:23:492 INFO  Listening http connections on 0.0.0.0:2480 (protocol v.10, socket=default) [OServerNetworkListener]
2020-02-07 10:49:23:493 INFO  Found ORIENTDB_ROOT_PASSWORD variable, using this value as root's password [OServer]
2020-02-07 10:49:23:496 WARNI onAfterDynamicPlugins() Configuration document is empty [ODefaultServerSecurity]
2020-02-07 10:49:23:498 WARNI GREMLIN language not available (not in classpath) [OGremlinHelper]
2020-02-07 10:49:23:498 INFO  [OVariableParser.resolveVariables] Property not found: distributed [orientechnologies]
2020-02-07 10:49:23:499 WARNI Authenticated clients can execute any kind of code into the server by using the following allowed languages: [sql] [OServerSideScriptInterpreter]
2020-02-07 10:49:23:500 INFO  OrientDB Studio available at http://192.168.9.22:2480/studio/index.html [OServer]
2020-02-07 10:49:23:500 INFO  OrientDB Server is active v3.0.27 - Veloce (build e4e73e77074c4f49337ae58b171513cd10ac1157, branch UNKNOWN). [OServer] *** ORIENT SERVER STARTED ***
*** create database schema ***

2020-02-07 10:49:23:505 INFO  WAL maximum segment size is set to 9,733 MB [OrientDBEmbedded]
2020-02-07 10:49:23:514 INFO  Storage 'memory:MyDB' is created under OrientDB distribution : 3.0.27 - Veloce (build e4e73e77074c4f49337ae58b171513cd10ac1157, branch UNKNOWN) [ODirectMemoryStorage]
2020-02-07 10:49:23:816 INFO  Storage 'memory:MyDB' is created under OrientDB distribution : 3.0.27 - Veloce (build e4e73e77074c4f49337ae58b171513cd10ac1157, branch UNKNOWN) [ODirectMemoryStorage]*** database schema successfully created ***
Use a pool for database connection with pool size 50
Exception `2AC09448` in storage `plocal:/space/USERS/gouit/workspace/testV3/target/databases/MyDB`: 3.0.27 - Veloce (build e4e73e77074c4f49337ae58b171513cd10ac1157, branch UNKNOWN)
com.orientechnologies.orient.core.exception.OStorageException: Cannot open the storage 'MyDB' because it does not exist in path: /space/USERS/gouit/workspace/testV3/target/databases/MyDB
	at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.open(OAbstractPaginatedStorage.java:287)
	at com.orientechnologies.orient.core.db.OrientDBEmbedded.open(OrientDBEmbedded.java:283)
	at com.orientechnologies.orient.core.db.OrientDBEmbedded.open(OrientDBEmbedded.java:228)
	at com.orientechnologies.orient.server.OServer.openDatabase(OServer.java:939)
	at com.orientechnologies.orient.server.OServer.openDatabase(OServer.java:913)
	at com.orientechnologies.orient.server.OConnectionBinaryExecutor.executeDatabaseOpen37(OConnectionBinaryExecutor.java:1187)
	at com.orientechnologies.orient.client.remote.message.OOpen37Request.execute(OOpen37Request.java:77)
	at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.sessionRequest(ONetworkProtocolBinary.java:310)
	at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.execute(ONetworkProtocolBinary.java:212)
	at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:69)

To launch it, here is my pom file (it is a maven project) and the configuration used:
pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

	<modelVersion>4.0.0</modelVersion>
	<groupId>testV3</groupId>
	<artifactId>testV3</artifactId>
	<version>1.0</version>
	<name>Test OrientDb V3.0</name>

    <properties>
        <COTS-orientdb.version>3.0.27</COTS-orientdb.version>
        <!--
        <COTS-orientdb.version>2.2.33</COTS-orientdb.version>
        <COTS-orientdb.version>3.0.27</COTS-orientdb.version>
        -->
    </properties>

	<dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
        </dependency>
		<dependency>
			<groupId>com.orientechnologies</groupId>
			<artifactId>orientdb-graphdb</artifactId>
	        <version>${COTS-orientdb.version}</version>
		</dependency>
	</dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.10</version>
					<configuration>
						<enableAssertions>true</enableAssertions>
						<systemPropertyVariables>
							<ORIENTDB_HOME>${project.build.directory}</ORIENTDB_HOME>
						</systemPropertyVariables>
						<environmentVariables>
							<ORIENTDB_HOME>${project.build.directory}</ORIENTDB_HOME>
						</environmentVariables>
					</configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>

src/test/resources/embeddedOrientServer.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<orient-server>
    <handlers>
        <handler class="com.orientechnologies.orient.graph.handler.OGraphServerHandler">
            <parameters>
                <parameter value="true" name="enabled"/>
                <parameter value="50" name="graph.pool.max"/>
            </parameters>
        </handler>
        <handler class="com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin">
            <parameters>
                <parameter value="${distributed}" name="enabled"/>
                <parameter value="${ORIENTDB_HOME}/config/default-distributed-db-config.json" name="configuration.db.default"/>
                <parameter value="${ORIENTDB_HOME}/config/hazelcast.xml" name="configuration.hazelcast"/>
            </parameters>
        </handler>
        <handler class="com.orientechnologies.orient.server.handler.OJMXPlugin">
            <parameters>
                <parameter value="false" name="enabled"/>
                <parameter value="true" name="profilerManaged"/>
            </parameters>
        </handler>
        <handler class="com.orientechnologies.orient.server.handler.OAutomaticBackup">
            <parameters>
                <parameter value="false" name="enabled"/>
                <parameter value="4h" name="delay"/>
                <parameter value="backup" name="target.directory"/>
                <parameter value="${DBNAME}-${DATE:yyyyMMddHHmmss}.zip" name="target.fileName"/>
                <parameter value="9" name="compressionLevel"/>
                <parameter value="1048576" name="bufferSize"/>
                <parameter value="" name="db.include"/>
                <parameter value="" name="db.exclude"/>
            </parameters>
        </handler>
        <handler class="com.orientechnologies.orient.server.handler.OServerSideScriptInterpreter">
            <parameters>
                <parameter value="true" name="enabled"/>
                <parameter value="SQL" name="allowedLanguages"/>
            </parameters>
        </handler>
        <handler class="com.orientechnologies.orient.server.token.OrientTokenHandler">
            <parameters>
                <parameter value="false" name="enabled"/>
                <parameter value="" name="oAuth2Key"/>
                <parameter value="60" name="sessionLength"/>
                <parameter value="HmacSHA256" name="encryptionAlgorithm"/>
            </parameters>
        </handler>
        <handler class="com.orientechnologies.orient.server.plugin.livequery.OLiveQueryPlugin">
            <parameters>
                <parameter value="false" name="enabled"/>
            </parameters>
        </handler>
    </handlers>
    <network>
        <sockets>
            <socket implementation="com.orientechnologies.orient.server.network.OServerSSLSocketFactory" name="ssl">
                <parameters>
                    <parameter value="false" name="network.ssl.clientAuth"/>
                    <parameter value="config/cert/orientdb.ks" name="network.ssl.keyStore"/>
                    <parameter value="password" name="network.ssl.keyStorePassword"/>
                    <parameter value="config/cert/orientdb.ks" name="network.ssl.trustStore"/>
                    <parameter value="password" name="network.ssl.trustStorePassword"/>
                </parameters>
            </socket>
            <socket implementation="com.orientechnologies.orient.server.network.OServerSSLSocketFactory" name="https">
                <parameters>
                    <parameter value="false" name="network.ssl.clientAuth"/>
                    <parameter value="config/cert/orientdb.ks" name="network.ssl.keyStore"/>
                    <parameter value="password" name="network.ssl.keyStorePassword"/>
                    <parameter value="config/cert/orientdb.ks" name="network.ssl.trustStore"/>
                    <parameter value="password" name="network.ssl.trustStorePassword"/>
                </parameters>
            </socket>
        </sockets>
        <protocols>
            <protocol implementation="com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary" name="binary"/>
            <protocol implementation="com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpDb" name="http"/>
        </protocols>
        <listeners>
            <listener protocol="binary" socket="default" port-range="2424-2424" ip-address="0.0.0.0"/>
            <listener protocol="http" socket="default" port-range="2480-2480" ip-address="0.0.0.0">
                <commands>
                    <command implementation="com.orientechnologies.orient.server.network.protocol.http.command.get.OServerCommandGetStaticContent" pattern="GET|www GET|studio/ GET| GET|*.htm GET|*.html GET|*.xml GET|*.jpeg GET|*.jpg GET|*.png GET|*.gif GET|*.js GET|*.css GET|*.swf GET|*.ico GET|*.txt GET|*.otf GET|*.pjs GET|*.svg GET|*.json GET|*.woff GET|*.ttf GET|*.svgz" stateful="false">
                        <parameters>
                            <entry value="Cache-Control: no-cache, no-store, max-age=0, must-revalidate\r\nPragma: no-cache" name="http.cache:*.htm *.html"/>
                            <entry value="Cache-Control: max-age=120" name="http.cache:default"/>
                        </parameters>
                    </command>
                    <command implementation="com.orientechnologies.orient.graph.server.command.OServerCommandGetGephi" pattern="GET|gephi/*" stateful="false"/>
                </commands>
                <parameters>
                    <parameter value="utf-8" name="network.http.charset"/>
                    <parameter value="true" name="network.http.jsonResponseError"/>
                </parameters>
            </listener>
        </listeners>
    </network>
    <storages/>
    <users>
        <user resources="*" password="root" name="root"/>
        <user resources="connect,server.listDatabases,server.dblist" password="guest" name="guest"/>
    </users>
    <properties>
        <entry value="1" name="db.pool.min"/>
        <entry value="50" name="db.pool.max"/>
        <entry value="false" name="profiler.enabled"/>
        <entry value="info" name="log.console.level"/>
        <entry value="fine" name="log.file.level"/>
        <entry value="false" name="environment.allowJVMShutdown"/>
        <entry value="512" name="storage.diskCache.bufferSize"/>
        <entry value="512" name="storage.wal.cacheSize"/>
    </properties>
</orient-server>

I’m sorry for this long post. I tried to give the more information I could.
Thanks to every one who can help me.

Hi @BenjaminG

in v 3.0 in order to create database on the server, you could do it from remote or if you are in embedded you should use the server context. In 2.2.x by using only urls in embedded it worked, but not in 3.0.x

Here it’s a working example

import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal;
import com.orientechnologies.orient.core.db.ODatabaseSession;
import com.orientechnologies.orient.core.db.ODatabaseType;
import com.orientechnologies.orient.core.db.OrientDB;
import com.orientechnologies.orient.core.metadata.schema.OClass;
import com.orientechnologies.orient.core.metadata.schema.OSchema;
import com.orientechnologies.orient.core.metadata.schema.OType;
import com.orientechnologies.orient.server.OServer;
import com.orientechnologies.orient.server.OServerMain;
import com.tinkerpop.blueprints.impls.orient.OrientBaseGraph;
import com.tinkerpop.blueprints.impls.orient.OrientGraphFactory;
import org.junit.Test;

public class TestServer {

  @Test
  public void test() throws Exception {
    // Initialize memory DB
    System.out.println("*** create embedded server ***");
    final OServer server = OServerMain.create();
    server.startup(getClass().getResourceAsStream("/embeddedOrientServer.xml"));
    server.activate();
    System.out.println(" *** ORIENT SERVER STARTED ***");

    System.out.println("*** create database schema ***");

    OrientDB context = server.getContext();
    context.createIfNotExists("MyDB", ODatabaseType.MEMORY);
    ODatabaseSession session = context.open("MyDB", "admin", "admin");

    final OSchema schema = session.getMetadata().getSchema();
    final OClass myClass = schema.createClass("MyClass", schema.getClass("V"));
    myClass.createProperty("MyAtt", OType.STRING);
    System.out.println("*** database schema successfully created ***");

    // Open remote connection on memory DB
    System.out.println("Use a pool for database connection with pool size " + 50);
    final String dbUrlRemote = "remote:localhost/MyDB";
    final OrientGraphFactory orientFactory = new OrientGraphFactory(dbUrlRemote, "admin", "admin").setupPool(1, 50);
    orientFactory.setAutoStartTx(false);

    final OrientBaseGraph orientBaseGraph = orientFactory.getNoTx();
    ODatabaseRecordThreadLocal.instance().set(orientBaseGraph.getRawGraph());

    // Create vertex
    orientBaseGraph.addVertex("class:MyClass", new Object[] { "MyAtt", "MyAttValue" });

    // Close DB
    orientBaseGraph.getRawGraph().close();
    server.shutdown();
  }
}

Let me know if this helps

Hi @wolf4ood

Thank you very much !
It completely solved my problem.

As there is a new version 3.0.28, I tried it.
Your working example doesn’t work with this new version. A file “/com/orientechnologies/orientdb.properties” seems to be missing. It is loaded when creating OServer by com.orientechnologies.common.log.OLogManagerOConstants class:

    final InputStream inputStream = OConstants.class.getResourceAsStream("/com/orientechnologies/orientdb.properties");

This missing file causes a NulPointerException.

Do you know what is this file and what are we supposed to put in ?
I found no information about it…

It works with an empty file but I would like to know what is the purpose of this file and if I am missing something.

Hi @BenjaminG

let me check. That file is suppose to be there for version logging

Hi @BenjaminG

i’ve just tried with 3.0.28 and it worked fine. Do you have a failing example?

Can you check inside orientdb-core-3.0.28 if the orientdb.properties file is there?

Thanks