Wouter
Wouter

Reputation: 4016

Orientdb blocks on a simple document insert

I am totally new to OrientDB so I am trying to tinker with it by simply inserting a document. I checked out some documentation and wrote this:

public static void main(String[] args) {
    ODatabaseDocumentTx db = ODatabaseDocumentPool.global().acquire("remote:localhost/petshop", "admin", "admin");
    try {
        db.begin(OTransaction.TXTYPE.OPTIMISTIC);
        ODocument animal = new ODocument("Animal");
        animal.field( "name", "Gaudi" );
        animal.field( "location", "Madrid" );
        animal.save();
        db.commit();
    } finally {
        db.close();
    }
}

Now the document gets inserted, I can check that from the console, but this program just hangs in db.commit();

Here is the thread it hangs on:

"main@1" prio=5 tid=0x1 nid=NA runnable
  java.lang.Thread.State: RUNNABLE
      at java.net.SocketInputStream.socketRead0(SocketInputStream.java:-1)
      at java.net.SocketInputStream.read(SocketInputStream.java:152)
      at java.net.SocketInputStream.read(SocketInputStream.java:122)
      at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
      at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
      - locked <0x4ff> (a java.io.BufferedInputStream)
      at java.io.DataInputStream.readInt(DataInputStream.java:387)
      at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.readInt(OChannelBinary.java:99)
      at com.orientechnologies.orient.client.remote.OStorageRemote.readCollectionChanges(OStorageRemote.java:1895)
      at com.orientechnologies.orient.client.remote.OStorageRemote.commit(OStorageRemote.java:1099)
      at com.orientechnologies.orient.client.remote.OStorageRemoteThread.commit(OStorageRemoteThread.java:456)
      at com.orientechnologies.orient.core.tx.OTransactionOptimistic.doCommit(OTransactionOptimistic.java:119)
      at com.orientechnologies.orient.core.tx.OTransactionOptimistic.commit(OTransactionOptimistic.java:105)
      at com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.commit(ODatabaseRecordTx.java:142)
      at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:504)
      at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:496)
      at OrientTest.main(OrientTest.java:23)

The server blurts out the following warning:

2014-05-29 12:03:17:922 WARN Current implementation of storage does not support sbtree collections [ODatabaseRecordAbstract$1]

Am I missing something? I am using orientdb 1.7.

Upvotes: 3

Views: 437

Answers (1)

Wouter
Wouter

Reputation: 4016

I created the database like this:

create database remote:localhost/petshopp root passwd local

While I should have used:

create database remote:localhost/petshopp root passwd plocal

Upvotes: 5

Related Questions