Hi,

I created a database and a class in it using the memory storage:

orientdb {server=remote:localhost/}> create database 
remote:localhost/petshop-memory admin admin memory

Creating database [remote:localhost/petshop-memory] using the storage type 
[memory]...
Disconnecting from remote server [remote:localhost/]...
OK
Connecting to database [remote:localhost/petshop-memory] with user 
'admin'...OK
Database created successfully.
orientdb {db=petshop-memory}> create class Person

Class created successfully. Total classes in database now: 11


I then use a java program to browse and insert into this database.  The 
java program hangs at doc.save();  The document is actually created, I can 
see it from the console.  But the ODocument.save() call never returns.   
 If the database was created using plocal, instead of memory, storage then 
it works fine fine.

My program:
public class Sandbox {

    private static ODatabaseDocumentTx getConnection() {
        return ODatabaseDocumentPool.global().acquire(
                "remote:localhost/petshop-memory", "admin", "admin");
    }

    private static void browse() {
        try (ODatabaseDocumentTx db = getConnection()) {
            for (ODocument doc : db.browseClass("Person")) {
                System.out.println("name=" + doc.field("name"));
            }
        }
    }

    private static void insert() {
        ODocument doc = new ODocument("Person");
        doc.field("name", "Luke");
        doc.save();
    }


    public static void main(String[] args) {
        browse();
        insert();
        browse();
    }
}


Thanks!
fei

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to