Using 2.0 RC1 solved my problem. Thanks!
On Friday, December 19, 2014 10:47:00 PM UTC-8, Andrey Lomakin wrote: > > Hi, > In 2.0 memory database was completely rewritten . Could you try 2.0 RC1 > version ? > 19 Дек 2014 г. 21:22 пользователь "fei" <[email protected] <javascript:>> > написал: > >> >> Sorry, my insert() code is actually: >> >> private static void insert() { >> try (ODatabaseDocumentTx db = ODatabaseDocumentPool.global().acquire >> ( >> "remote:localhost/petshop", "admin", "admin")) { >> >> ODocument doc = new ODocument("Person"); >> doc.field("name", "Luke"); >> doc.save(); >> } >> } >> >> >> If the database is using plocal(create database remote:localhost/phoebe >> admin admin plocal) storage, it works fine. >> >> If the database is using memory storage(create database >> remote:localhost/phoebe admin admin memory), it hangs on the >> ODocument.save() after the record is created. >> >> I am using orientdb-community-1.7.9. >> >> I read this thread: >> >> https://groups.google.com/forum/#!searchin/orient-database/odocument$20save/orient-database/8t3MLFhLNbM/ZtybsWPib7AJ >> >> In that thread the problem was solved by using "plocal" instead of >> "local" storage. But my problem is about using the memory storage. The >> symptom looks the same though. >> >> Any help is appreciated. >> >> -fei >> >> On Thursday, December 18, 2014 9:48:52 PM UTC-8, fei wrote: >>> >>> 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] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > -- --- 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.
