errors

354 views
Skip to first unread message

fabiopedrosa

unread,
Feb 23, 2011, 10:21:35 PM2/23/11
to OrientDB
I'm using orientdb 0.9.24 and have errors in this simple code:

public class Main {
static Random rnd = new Random();

static class Customer {
String name;
int age;

public Customer() {
}

public Customer(String name, int age) {
this.name = name;
this.age = age;
}
}

public static void main(String[] args) {
ODatabaseObjectTx db = new ODatabaseObjectTx("local:db\\db");
if (db.exists())
db.open("admin", "admin");
else
db.create();
db.getEntityManager().registerEntityClass(Customer.class);

db.getMetadata().getSchema().getClass(Customer.class).createProperty("age",
OType.INTEGER).createIndex(INDEX_TYPE.UNIQUE);

for (Object obj : db.browseClass(Customer.class))
db.delete(obj);
System.out.println("All deleted");

int N = 15000;

long startTime = System.currentTimeMillis();
for (int i = 0; i < N; i++)
db.save(new Customer("name ", i));
System.out.println("Saving took " + (System.currentTimeMillis() -
startTime) + "ms");

startTime = System.currentTimeMillis();
for (int i = 0; i < N; i++)
db.query(new OSQLSynchQuery<Customer>("select * from Customer where
age = " + rnd.nextInt(N))).get(0);
System.out.println("Loading took " + (System.currentTimeMillis() -
startTime) + "ms");

}
}


i have this 3 different exceptions:

this first happens if I close my app "unexpectedly":

2011-02-24 03:12:53:187 WARN [ODataLocal] Segment file default.0.oda
was not closed correctly last time. Checking segments...
2011-02-24 03:12:53:187 WARN [ODataLocal] OK
2011-02-24 03:12:53:187 WARN [ODataLocalHole] File db\default.odh was
not closed correctly last time. Checking segments...
2011-02-24 03:12:53:187 WARN [OClusterLocal] Segment file internal.
0.ocl was not closed correctly last time. Checking segments...
2011-02-24 03:12:53:187 WARN [OClusterLocal] OK
2011-02-24 03:12:53:187 WARN [OClusterLocalHole] File db\internal.och
was not closed correctly last time. Checking segments...
2011-02-24 03:12:53:187 WARN [OClusterLocal] Segment file index.0.ocl
was not closed correctly last time. Checking segments...
2011-02-24 03:12:53:187 WARN [OClusterLocal] OK
2011-02-24 03:12:53:187 WARN [OClusterLocalHole] File db\index.och was
not closed correctly last time. Checking segments...
2011-02-24 03:12:53:187 WARN [OClusterLocal] Segment file default.
0.ocl was not closed correctly last time. Checking segments...
2011-02-24 03:12:53:187 WARN [OClusterLocal] OK
2011-02-24 03:12:53:187 WARN [OClusterLocalHole] File db\default.och
was not closed correctly last time. Checking segments...
2011-02-24 03:12:53:750 WARN [OClusterLocal] Segment file orole.0.ocl
was not closed correctly last time. Checking segments...
2011-02-24 03:12:53:750 WARN [OClusterLocal] OK
2011-02-24 03:12:53:765 WARN [OClusterLocalHole] File db\orole.och was
not closed correctly last time. Checking segments...
2011-02-24 03:12:53:765 WARN [OClusterLocal] Segment file ouser.0.ocl
was not closed correctly last time. Checking segments...
2011-02-24 03:12:53:765 WARN [OClusterLocal] OK
2011-02-24 03:12:53:765 WARN [OClusterLocalHole] File db\ouser.och was
not closed correctly last time. Checking segments...
2011-02-24 03:12:53:765 WARN [OClusterLocal] Segment file customer.
0.ocl was not closed correctly last time. Checking segments...
2011-02-24 03:12:53:765 WARN [OClusterLocal] OK
2011-02-24 03:12:53:765 WARN [OClusterLocalHole] File customer.och was
not closed correctly last time. Checking segments...
2011-02-24 03:12:53:765 WARN [OTxSegment] File db\txlog.otx was not
closed correctly last time. Checking segments...
2011-02-24 03:12:53:921 SEVE [OMVRBTreeEntryDatabase]
checkEntryStructure: Wrong parent node loaded: 1:123
2011-02-24 03:12:53:921 SEVE [OMVRBTreeEntryDatabase]
checkEntryStructure: Wrong parent node loaded: 1:123
... lots like this...
2011-02-24 03:12:54:156 SEVE [OMVRBTreeEntryDatabase]
checkEntryStructure: Wrong parent node loaded: 1:123
2011-02-24 03:12:54:156 SEVE [OMVRBTreeEntryDatabase]
checkEntryStructure: Wrong parent node loaded: 1:123
2011-02-24 03:12:54:156 SEVE [OMVRBTreeEntryDatabase]
checkEntryStructure: Wrong parent node loaded: 1:123
2011-02-24 03:12:54:156 SEVE [OMVRBTreeEntryDatabase]
checkEntryStructure: Wrong parent node loaded: 1:123All deleted
Exception in thread "main"
com.orientechnologies.orient.core.exception.ODatabaseException: Error
on saving record in cluster #-1
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.executeSaveRecord(ODatabaseRecordAbstract.java:
458)
at
com.orientechnologies.orient.core.tx.OTransactionNoTx.save(OTransactionNoTx.java:
49)
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.save(ODatabaseRecordTx.java:
91)
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.save(ODatabaseRecordTx.java:
30)
at
com.orientechnologies.orient.core.db.ODatabaseRecordWrapperAbstract.save(ODatabaseRecordWrapperAbstract.java:
114)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:
134)
at
com.orientechnologies.orient.core.db.object.ODatabaseObjectTx.save(ODatabaseObjectTx.java:
174)
at
com.orientechnologies.orient.core.db.object.ODatabaseObjectTx.save(ODatabaseObjectTx.java:
149)
at Main.main(Main.java:41)
Caused by: com.orientechnologies.orient.core.index.OIndexException:
Found duplicated key '5' for property 'age (type=INTEGER)'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
com.orientechnologies.common.log.OLogManager.exception(OLogManager.java:
180)
at
com.orientechnologies.orient.core.index.OPropertyIndexManager.checkIndexedProperties(OPropertyIndexManager.java:
156)
at
com.orientechnologies.orient.core.index.OPropertyIndexManager.onRecordBeforeCreate(OPropertyIndexManager.java:
44)
at
com.orientechnologies.orient.core.hook.ODocumentHookAbstract.onTrigger(ODocumentHookAbstract.java:
60)
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.callbackHooks(ODatabaseRecordAbstract.java:
545)
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.executeSaveRecord(ODatabaseRecordAbstract.java:
413)
... 8 more

this happens quite often:

Exception in thread "main"
com.orientechnologies.orient.core.exception.ODatabaseException: Error
on deleting record #5:2959 of class 'Customer'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
com.orientechnologies.common.log.OLogManager.exception(OLogManager.java:
172)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.delete(ODatabaseDocumentTx.java:
148)
at
com.orientechnologies.orient.core.db.object.ODatabaseObjectTx.delete(ODatabaseObjectTx.java:
192)
at Main.main(Main.java:21)
Caused by:
com.orientechnologies.orient.core.exception.ODatabaseException: Error
on deleting record in cluster #5
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.executeDeleteRecord(ODatabaseRecordAbstract.java:
489)
at
com.orientechnologies.orient.core.tx.OTransactionNoTx.delete(OTransactionNoTx.java:
56)
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.delete(ODatabaseRecordTx.java:
97)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.delete(ODatabaseDocumentTx.java:
145)
... 2 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at
com.orientechnologies.orient.core.type.tree.OMVRBTreeEntryPersistent.getKeyAt(OMVRBTreeEntryPersistent.java:
545)
at
com.orientechnologies.common.collection.OMVRBTreeEntry.getKey(OMVRBTreeEntry.java:
163)
at
com.orientechnologies.common.collection.OMVRBTreeEntry.getLastKey(OMVRBTreeEntry.java:
378)
at
com.orientechnologies.common.collection.OMVRBTree.getEntry(OMVRBTree.java:
361)
at
com.orientechnologies.common.collection.OMVRBTree.getEntry(OMVRBTree.java:
311)
at
com.orientechnologies.common.collection.OMVRBTree.remove(OMVRBTree.java:
708)
at
com.orientechnologies.orient.core.type.tree.OMVRBTreePersistent.remove(OMVRBTreePersistent.java:
279)
at
com.orientechnologies.orient.core.index.OPropertyIndexMVRBTreeAbstract.remove(OPropertyIndexMVRBTreeAbstract.java:
176)
at
com.orientechnologies.orient.core.index.OPropertyIndexManager.onRecordAfterDelete(OPropertyIndexManager.java:
118)
at
com.orientechnologies.orient.core.hook.ODocumentHookAbstract.onTrigger(ODocumentHookAbstract.java:
81)
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.callbackHooks(ODatabaseRecordAbstract.java:
545)
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.executeDeleteRecord(ODatabaseRecordAbstract.java:
481)
... 5 more

this one is also weird because I delete all before creating new items:

Exception in thread "main"
com.orientechnologies.orient.core.exception.ODatabaseException: Error
on saving record in cluster #-1
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.executeSaveRecord(ODatabaseRecordAbstract.java:
458)
at
com.orientechnologies.orient.core.tx.OTransactionNoTx.save(OTransactionNoTx.java:
49)
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.save(ODatabaseRecordTx.java:
91)
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.save(ODatabaseRecordTx.java:
30)
at
com.orientechnologies.orient.core.db.ODatabaseRecordWrapperAbstract.save(ODatabaseRecordWrapperAbstract.java:
114)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:
134)
at
com.orientechnologies.orient.core.db.object.ODatabaseObjectTx.save(ODatabaseObjectTx.java:
174)
at
com.orientechnologies.orient.core.db.object.ODatabaseObjectTx.save(ODatabaseObjectTx.java:
149)
at Main.main(Main.java:41)
Caused by: com.orientechnologies.orient.core.index.OIndexException:
Found duplicated key '5' for property 'age (type=INTEGER)'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
com.orientechnologies.common.log.OLogManager.exception(OLogManager.java:
180)
at
com.orientechnologies.orient.core.index.OPropertyIndexManager.checkIndexedProperties(OPropertyIndexManager.java:
156)
at
com.orientechnologies.orient.core.index.OPropertyIndexManager.onRecordBeforeCreate(OPropertyIndexManager.java:
44)
at
com.orientechnologies.orient.core.hook.ODocumentHookAbstract.onTrigger(ODocumentHookAbstract.java:
60)
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.callbackHooks(ODatabaseRecordAbstract.java:
545)
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.executeSaveRecord(ODatabaseRecordAbstract.java:
413)
... 8 more

and this is the trickiest, because it simply shouldn't happen:

Saving took 2344ms
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index:
0, Size: 0
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at Main.main(Main.java:46)

Luca Garulli

unread,
Feb 24, 2011, 10:10:00 AM2/24/11
to orient-database, fabiopedrosa
I strongly suggest to not use 0.9.24 with large use of transactions and indexes... Much better use the last 0.9.25-snapshot

Soon the definitive release with a lot of bugs fixed.

Lvc@

Jon S

unread,
Feb 25, 2011, 12:24:18 PM2/25/11
to OrientDB
Luca,

I also have errors running the code from 'fabiopedrosa', I
modified his java file 'Main.java' slightly but and get errors
like:

"java.lang.Integer cannot be cast to java.lang.String"

the above seem to be the culprit. Note this message doesn't exist in
'fabiopedrosa's eror trace. See my version of Main.java (below)
and its associated error trace (which is quite different).

FYI, I too have lots of issues in getting working stand alone
Test programs to work especially those that uses indecies -
please refer to my prior Feb 22, 2011 post/thread - subject:
"Need more examples that are simple, easy, and standalone"
which remains unanswered.

Thus when I saw 'fabiopedrosa' code/question I thought I would
try to run/debug it. But once again I can not get things to work
as they should.

Hacking a bit, if I found that if I alter 'age' from an 'int' to a
'String'
then I can get most of his code to run, but it would fail on
OSQLSynchQuery - but if I further altered 'fabiopedrosa's query
block as follows:

from:

db.query(new OSQLSynchQuery<Customer>(
"select * from Customer where age = " +
rnd.nextInt(N))).get(0);
to:
ArrayList res = db.query(new OSQLSynchQuery<Customer>(
"select * from Customer where age = " + rnd.nextInt(N)));

if (res != null && res.isEmpty() == false) {
// System.out.println("" + res);
res.get(0);
}

I can get a clean run (but it is for 'age' being a 'String', I have
no idea why 'age' can not be an 'int' in the the way 'fabiopedrosa'
coded his initial class it seems straigtforward. For the version that
can actual run without an exception see Main2.java (below)

BTW Orient DB in this test case sure does not seem fast - I am
only able to query less than 10 items per second.

5.9 sec. to save [252.228 items/sec.] for 1,500 items
155.5 sec. to load [ 9.640 items/sec.] (i.e. query 1,500 items)


Best Regards,

Jon Strabala

--------------------------------------------------------------
My system a solaris 10 box on svn 0.9.25-SNAPSHOT of OrientDB:
--------------------------------------------------------------

orientdb# uname -a
SunOS orientdb 5.10 Generic_142901-11 i86pc i386 i86pc

orientdb# cat /etc/release
Solaris 10 10/09 s10x_u8wos_08a X86
Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 16 September 2009

orientdb# pwd
/OrientDB/svn/releases/0.9.25-SNAPSHOT/qsi/test2

--------------------------------------------------------------
I run "1.6.0_21" 32-bit java
--------------------------------------------------------------

orientdb# java -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) Client VM (build 17.0-b16, mixed mode, sharing)

--------------------------------------------------------------
It appears 'fabiopedrosa' runs DOS, I run UNIX/Solaris 10
--------------------------------------------------------------

orientdb# grep ODatabaseObjectTx Main.java
// ODatabaseObjectTx db = new ODatabaseObjectTx("local:db\
\db");
ODatabaseObjectTx db = new ODatabaseObjectTx("local:/tmp/
lspeed");

--------------------------------------------------------------
remove OLD db file and run twice.
--------------------------------------------------------------

orientdb# rm -rf /tmp/lspeed

orientdb# java -ea -cp $MYCP Main
All deleted, 0 items
Exception in thread "main"
com.orientechnologies.orient.core.exception.ODatabaseException: Error
on saving record in cluster #-1
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.executeSaveRecord(ODatabaseRecordAbstract.java:
479)
at
com.orientechnologies.orient.core.tx.OTransactionNoTx.save(OTransactionNoTx.java:
50)
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.save(ODatabaseRecordTx.java:
156)
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.save(ODatabaseRecordTx.java:
33)
at
com.orientechnologies.orient.core.db.ODatabaseRecordWrapperAbstract.save(ODatabaseRecordWrapperAbstract.java:
127)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.save(ODatabaseDocumentTx.java:
148)
at
com.orientechnologies.orient.core.db.object.ODatabaseObjectTx.save(ODatabaseObjectTx.java:
195)
at
com.orientechnologies.orient.core.db.object.ODatabaseObjectTx.save(ODatabaseObjectTx.java:
169)
at Main.main(Main.java:63)
Caused by: java.lang.ClassCastException: java.lang.Integer cannot be
cast to java.lang.String
at java.lang.String.compareTo(String.java:92)
at
com.orientechnologies.common.collection.OMVRBTree.getEntry(OMVRBTree.java:
395)
at
com.orientechnologies.common.collection.OMVRBTree.getEntry(OMVRBTree.java:
347)
at
com.orientechnologies.common.collection.OMVRBTree.get(OMVRBTree.java:
272)
at
com.orientechnologies.orient.core.type.tree.OMVRBTreePersistent.get(OMVRBTreePersistent.java:
707)
at
com.orientechnologies.orient.core.index.OIndexMVRBTreeAbstract.get(OIndexMVRBTreeAbstract.java:
135)
at
com.orientechnologies.orient.core.index.OIndexUnique.checkEntry(OIndexUnique.java:
63)
at
com.orientechnologies.orient.core.index.OPropertyIndex.checkEntry(OPropertyIndex.java:
65)
at
com.orientechnologies.orient.core.index.OPropertyIndexManager.checkIndexedProperties(OPropertyIndexManager.java:
146)
at
com.orientechnologies.orient.core.index.OPropertyIndexManager.onRecordBeforeCreate(OPropertyIndexManager.java:
40)
at
com.orientechnologies.orient.core.hook.ODocumentHookAbstract.onTrigger(ODocumentHookAbstract.java:
68)
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.callbackHooks(ODatabaseRecordAbstract.java:
568)
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.executeSaveRecord(ODatabaseRecordAbstract.java:
427)
... 8 more
du -sk /tmp/lspeed
19164 /tmp/lspeed

orientdb# java -ea -cp $MYCP Main
Exception in thread "main"
com.orientechnologies.orient.core.exception.ODatabaseException: Error
on deleting record #5:0 of class 'Customer'
at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:
27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:
513)
at
com.orientechnologies.common.log.OLogManager.exception(OLogManager.java:
172)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.delete(ODatabaseDocumentTx.java:
161)
at
com.orientechnologies.orient.core.db.object.ODatabaseObjectTx.delete(ODatabaseObjectTx.java:
219)
at Main.main(Main.java:54)
Caused by:
com.orientechnologies.orient.core.exception.ODatabaseException: Error
on deleting record in cluster #5
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.executeDeleteRecord(ODatabaseRecordAbstract.java:
510)
at
com.orientechnologies.orient.core.tx.OTransactionNoTx.delete(OTransactionNoTx.java:
57)
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.delete(ODatabaseRecordTx.java:
162)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.delete(ODatabaseDocumentTx.java:
158)
... 2 more
Caused by: java.lang.ClassCastException: java.lang.String cannot be
cast to java.lang.Integer
at java.lang.Integer.compareTo(Integer.java:37)
at
com.orientechnologies.common.collection.OMVRBTree.getEntry(OMVRBTree.java:
395)
at
com.orientechnologies.common.collection.OMVRBTree.getEntry(OMVRBTree.java:
347)
at
com.orientechnologies.common.collection.OMVRBTree.remove(OMVRBTree.java:
687)
at
com.orientechnologies.orient.core.type.tree.OMVRBTreePersistent.remove(OMVRBTreePersistent.java:
406)
at
com.orientechnologies.orient.core.index.OIndexMVRBTreeAbstract.remove(OIndexMVRBTreeAbstract.java:
269)
at
com.orientechnologies.orient.core.index.OPropertyIndexManager.onRecordAfterDelete(OPropertyIndexManager.java:
129)
at
com.orientechnologies.orient.core.hook.ODocumentHookAbstract.onTrigger(ODocumentHookAbstract.java:
82)
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.callbackHooks(ODatabaseRecordAbstract.java:
568)
at
com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.executeDeleteRecord(ODatabaseRecordAbstract.java:
502)
... 5 more
du -sk /tmp/lspeed
19168 /tmp/lspeed


--------------------------------------------------------------
Failing source almost the same as 'fabiopedrosa's original
orientdb# cat Main.java
--------------------------------------------------------------

import java.io.File;
import java.util.Random;

import org.testng.annotations.Test;
import com.orientechnologies.common.profiler.OProfiler;

import
com.orientechnologies.orient.core.db.document.ODatabaseDocument;
import
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;
import com.orientechnologies.orient.core.intent.OIntentMassiveInsert;
import com.orientechnologies.orient.core.metadata.schema.OProperty;
import com.orientechnologies.orient.core.record.impl.ODocument;
import com.orientechnologies.orient.core.tx.OTransaction.TXTYPE;
import
com.orientechnologies.orient.test.database.base.OrientMonoThreadTest;

import com.orientechnologies.orient.core.db.object.*;
import com.orientechnologies.orient.core.sql.query.*;
import com.orientechnologies.orient.core.metadata.schema.OType;
import
com.orientechnologies.orient.core.metadata.schema.OProperty.INDEX_TYPE;

public class Main {

static Random rnd = new Random();

static class Customer {
String name;
int age;

public Customer() { }

public Customer(String name, int age) {
this.name = name;
this.age = age;
}
}

public static void main(String[] args) {

int cnt;
// ODatabaseObjectTx db = new ODatabaseObjectTx("local:db\
\db");
ODatabaseObjectTx db = new ODatabaseObjectTx("local:/tmp/
lspeed");
if (db.exists()) {
db.open("admin", "admin");
} else {
db.create();
}

db.getEntityManager().registerEntityClass(Customer.class);


db.getMetadata().getSchema().getClass(Customer.class).createProperty(
"age", OType.INTEGER).createIndex(INDEX_TYPE.UNIQUE);

cnt = 0;
for (Object obj : db.browseClass(Customer.class)) {
db.delete(obj);
cnt++;
}

System.out.println("All deleted, " + cnt + " items");

int N = 15000;
long startTime = System.currentTimeMillis();
for (int i = 0; i < N; i++) {
db.save(new Customer("name ", i));
}
System.out.println("Saving took " +
(System.currentTimeMillis() - startTime) + "ms");

startTime = System.currentTimeMillis();
for (int i = 0; i < N; i++) {
db.query(new OSQLSynchQuery<Customer>(
"select * from Customer where age = " +
rnd.nextInt(N))).get(0);
}
System.out.println("Loading took " +
(System.currentTimeMillis() - startTime) + "ms");
}
}

--------------------------------------------------------------
Working source altered age from 'int' to 'String'
orientdb# cat Main2.java
--------------------------------------------------------------

import java.io.File;
import java.util.Random;
import java.util.ArrayList;

import org.testng.annotations.Test;
import com.orientechnologies.common.profiler.OProfiler;

import
com.orientechnologies.orient.core.db.document.ODatabaseDocument;
import
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;
import com.orientechnologies.orient.core.intent.OIntentMassiveInsert;
import com.orientechnologies.orient.core.metadata.schema.OProperty;
import com.orientechnologies.orient.core.record.impl.ODocument;
import com.orientechnologies.orient.core.tx.OTransaction.TXTYPE;
import
com.orientechnologies.orient.test.database.base.OrientMonoThreadTest;

import com.orientechnologies.orient.core.db.object.*;
import com.orientechnologies.orient.core.sql.query.*;
import com.orientechnologies.orient.core.metadata.schema.OType;
import
com.orientechnologies.orient.core.metadata.schema.OProperty.INDEX_TYPE;

public class Main2 {

static Random rnd = new Random();

static class Customer {
String name;
String age;

public Customer() { }

public Customer(String name, String age) {
this.name = name;
this.age = age;
}
}

public static void main(String[] args) {

int cnt;
// ODatabaseObjectTx db = new ODatabaseObjectTx("local:db\\db");
ODatabaseObjectTx db = new ODatabaseObjectTx("local:/tmp/lspeed");
if (db.exists()) {
db.open("admin", "admin");
} else {
db.create();
}

db.getEntityManager().registerEntityClass(Customer.class);


db.getMetadata().getSchema().getClass(Customer.class).createProperty(
"age", OType.STRING).createIndex(INDEX_TYPE.UNIQUE);

cnt = 0;
for (Object obj : db.browseClass(Customer.class)) {
db.delete(obj);
cnt++;
}

System.out.println("All deleted, " + cnt + " items");

int N = 15000;
long startTime = System.currentTimeMillis();
for (int i = 0; i < N; i++) {
db.save(new Customer("name ", ""+i));
}
System.out.println("Saving took " +
(System.currentTimeMillis() - startTime) + "ms");

startTime = System.currentTimeMillis();
for (int i = 0; i < N; i++) {
ArrayList res = db.query(new OSQLSynchQuery<Customer>(
"select * from Customer where age = \"" + rnd.nextInt(N) +
"\"" ));

if (res != null && res.isEmpty() == false) {
System.out.println("" + res);
res.get(0);
}
}
System.out.println("Loading took " +
(System.currentTimeMillis() - startTime) + "ms");
}
}

--------------------------------------------------------------
Run the rwWorking source altered age from 'int' to 'String'
hmmm it is pretty slow .... so slow I lowered 'N' just to get
a number from 15,000 down to 1,500. I question whether the
search even begins to behave in a near linear fashion.
--------------------------------------------------------------

#----------------
# if N = 15000; // as per original code
#----------------
orientdb# java -ea -cp $MYCP Main2
All deleted, 0 items
Saving took 7453ms
^C

Killed the run as I got tired of waiting (about five minutes)
either the code hangs or it is massively slow and non-scalable.

7.5 sec. to save [2,012.612 items/sec.] for 15,500 items
???.? sec. to load [ ?.??? items/sec.] (i.e. query 15,000 items)

#----------------
# if N = 1500;
#----------------
orientdb# java -ea -cp $MYCP Main2
All deleted, 0 items
Saving took 5947ms
Loading took 155599ms

5.9 sec. to save [252.228 items/sec.] for 1,500 items
155.5 sec. to load [ 9.640 items/sec.] (i.e. query 1,500 items)

IMHO ... This is very very slow .... almost unusable slow

Jon S

unread,
Feb 25, 2011, 2:37:54 PM2/25/11
to OrientDB
Just to be clear about the performance issue (still don't know why I
needed to change 'age' from an 'int' to a 'String' in 'fabiopedrosa's
code.) I benchmarked a few different "count's of objects in the
database.

It appears that relatively small unit tests will let a major defect go
unnoticed.

RUNS WITH *** java -ea -cp $MYCP Main2

declareIntent OIntentMassiveInsert
db.delete : took 0.002 sec., 0 items
db.save : took 0.036 sec., 50 items, 1388.889 items/sec.
db.query : took 0.196 sec., 50 items, 255.102 items/sec.

declareIntent OIntentMassiveInsert
db.delete : took 0.002 sec., 0 items
db.save : took 0.059 sec., 100 items, 1694.915 items/sec.
db.query : took 0.264 sec., 100 items, 378.788 items/sec.

declareIntent OIntentMassiveInsert
db.delete : took 0.002 sec., 0 items
db.save : took 0.253 sec., 500 items, 1976.285 items/sec.
db.query : took 2.406 sec., 500 items, 207.814 items/sec.

declareIntent OIntentMassiveInsert
db.delete : took 0.002 sec., 0 items
db.save : took 0.347 sec., 1000 items, 2881.844 items/sec.
db.query : took 9.483 sec., 1000 items, 105.452 items/sec.

declareIntent OIntentMassiveInsert
db.delete : took 0.003 sec., 0 items
db.save : took 0.532 sec., 2000 items, 3759.398 items/sec.
db.query : took 37.288 sec., 2000 items, 53.637 items/sec.

declareIntent OIntentMassiveInsert
db.delete : took 0.003 sec., 0 items
db.save : took 0.572 sec., 2500 items, 4370.629 items/sec.
db.query : took 57.871 sec., 2500 items, 43.200 items/sec.

declareIntent OIntentMassiveInsert
db.delete : took 0.002 sec., 0 items
db.save : took 0.583 sec., 2750 items, 4716.981 items/sec.
db.query : took 75.033 sec., 2750 items, 36.651 items/sec.

declareIntent OIntentMassiveInsert
db.delete : took 0.002 sec., 0 items
db.save : took 0.604 sec., 3000 items, 4966.887 items/sec.
db.query : took 89.562 sec., 3000 items, 33.496 items/sec.

declareIntent OIntentMassiveInsert
db.delete : took 0.002 sec., 0 items
db.save : took 0.677 sec., 4000 items, 5908.419 items/sec.
db.query : took 145.600 sec., 4000 items, 27.473 items/sec.

declareIntent OIntentMassiveInsert
db.delete : took 0.002 sec., 0 items
db.save : took 0.793 sec., 5000 items, 6305.170 items/sec.
db.query : took 237.231 sec., 5000 items, 21.077 items/sec.

THIS RUN WITH *** java -Xmx800m -Xms600m -ea -cp $MYCP Main2

declareIntent OIntentMassiveInsert
db.delete : took 0.002 sec., 0 items
db.save : took 0.846 sec., 5000 items, 5910.165 items/sec.
db.query : took 231.109 sec., 5000 items, 21.635 items/sec.

===========================================
During the N = 5000 (5K) run:

We have no IO at all - but the JVM is using 99% of the CPU

orientdb# iostat -x 3 3
extended device statistics
device r/s w/s kr/s kw/s wait actv svc_t %w %b
sd0 0.0 0.4 2.4 9.5 0.0 0.0 14.7 0 0
sd1 0.0 0.4 2.4 9.5 0.0 0.0 10.7 0 0
sd2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
extended device statistics
device r/s w/s kr/s kw/s wait actv svc_t %w %b
sd0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
sd1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
sd2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
extended device statistics
device r/s w/s kr/s kw/s wait actv svc_t %w %b
sd0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
sd1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
sd2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0

orientdb# top -b -n 2
load averages: 1.04, 0.68, 0.50; up 7+10:13:58
11:07:02
42 processes: 39 sleeping, 2 running, 1 on cpu
CPU states: 0.0% idle, 99.0% user, 1.0% kernel, 0.0% iowait, 0.0%
swap
Memory: 4094M phys mem, 834M free mem, 2047M total swap, 2039M free
swap

PID USERNAME LWP PRI NICE SIZE RES STATE TIME CPU COMMAND
29524 root 10 20 0 62M 32M run 3:28 99.14% java
29561 root 1 59 0 2964K 1564K cpu 0:00 0.09% top

And it is not a JVM memory issue as all the following invocations
essentially have identical issues.

java -ea -cp $MYCP Main2
java -Xmx800m -ea -cp $MYCP Main2
java -Xmx800m -Xms600m -ea -cp $MYCP Main2

I even made sure the server was using lots of memory via -Xms512m -
Xmx512m
and the client (Main2) was running with -Xmx400m - same result.

It appears a profiler is needed to find the "hot spot" or defect in
the code.
Based upon the PID's it appears that the server is fine, and that it
is the
client (Main2) in a busy spin. So I ran the following:

java -Xrunhprof:cpu=samples,depth=30,file=myprogram.hprof -ea -cp
$MYCP Main2

refer to : http://www.thunderguy.com/semicolon/2004/04/18/profiling-a-java-program-easily/

I show the top 26 items below ... it might help a bit

CPU SAMPLES BEGIN (total = 2547) Fri Feb 25 11:33:24 2011
rank self accum count trace method
1 5.58% 5.58% 142 300800
com.orientechnologies.orient.core.serialization.serializer.OStringSerializerHelper.isCharPresent
2 5.26% 10.84% 134 300799 java.lang.StringBuilder.append
3 3.06% 13.90% 78 300787
com.orientechnologies.common.profiler.OProfiler.stopChrono
4 2.91% 16.80% 74 300779
com.orientechnologies.common.profiler.OProfiler.stopChrono
5 2.67% 19.47% 68 300768
com.orientechnologies.orient.core.serialization.OBinaryProtocol.bytes2string
6 2.24% 21.71% 57 300812 sun.misc.Unsafe.copyMemory
7 2.12% 23.83% 54 300801 java.lang.Character.toLowerCase
8 1.73% 25.56% 44 300804
com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerStringAbstract.fieldTypeFromStrea
m
9 1.61% 27.17% 41 300777 java.util.HashMap.put
10 1.53% 28.70% 39 300821
com.orientechnologies.orient.core.storage.impl.local.OClusterLocal.getPhysicalPosition
11 1.37% 30.07% 35 300781 java.lang.String.<init>
12 1.22% 31.29% 31 300774 java.lang.Character.toLowerCase
13 1.22% 32.51% 31 300870 java.util.HashMap
$HashIterator.nextEntry
14 1.10% 33.61% 28 300838 java.lang.String.toLowerCase
15 1.06% 34.67% 27 300780 java.util.HashMap.size
16 1.06% 35.73% 27 300817 java.lang.Integer.getChars
17 1.02% 36.75% 26 300832 java.lang.Character.toLowerCase
18 1.02% 37.77% 26 300782 java.util.ArrayList.<init>
19 0.94% 38.71% 24 300769 java.util.HashMap.put
20 0.86% 39.58% 22 300776 java.lang.String.<init>
21 0.86% 40.44% 22 300791
com.orientechnologies.orient.core.serialization.serializer.OStringSerializerHelper.parse
22 0.86% 41.30% 22 300826 java.lang.String.<init>
23 0.82% 42.13% 21 300848
com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerSchemaAware2CSV.fromString
24 0.82% 42.95% 21 300847
com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerSchemaAware2CSV.fromString
25 0.82% 43.78% 21 300845 java.util.HashMap.clear
26 0.79% 44.56% 20 300815
com.orientechnologies.orient.core.sql.filter.OSQLFilter.evaluate



Luca Garulli

unread,
Feb 27, 2011, 7:12:24 AM2/27/11
to orient-database, Jon S
Hi,
thanks for the very detailed and deep analysis of this problem. Latest snapshot has a brand new memory model. Now it's much more efficient on traversing graphs and in general all the read operations. Furthermore I've fixed some bugs relative to the MVRB-Tree management and your test works correctly.

Please Fabio could you re-execute the test? And Jon could you execute the same test against the same hw/sw configuration of last time but with the snapshot released some hours ago?

Thanks,
Lvc@

imikhayl

unread,
Jul 31, 2012, 11:23:07 AM7/31/12
to orient-...@googlegroups.com, Jon S
Hi, I'm facing with another issue related to fixed one (version 1.1.0 - latest snapshot):
I have the following at the log:
    30.07.2012 15:48:05 com.orientechnologies.common.log.OLogManager log
[2012-07-30 15:48:05.460] http-8443-2                  System.err                                                        WARNING: Connection re-acquired transparently after 516ms and 1 retries: no errors will be thrown at application level

after that I have 99.9% of cpu usage by orientdb... it becomes very slow..(

воскресенье, 27 февраля 2011 г., 14:12:24 UTC+2 пользователь Lvc@ написал:

Luca Garulli

unread,
Jul 31, 2012, 11:27:16 AM7/31/12
to orient-...@googlegroups.com, Jon S
Hi,
please update to latest 1.2.0-SNAPSHOT that fixed a bug on socket close in this case.

About the message "Connection re-acquired transparently after" it's normal and can happen when timeouts expire. The connection is re-acquired, so no data is lost.

Lvc@

--
 
 
 

imikhayl

unread,
Jul 31, 2012, 1:31:04 PM7/31/12
to orient-...@googlegroups.com, Jon S
do I have to update the client version as well or thats enough to update only server from here: http://datastorm.com.ua/jenkins/job/orient-svn-maven/lastBuild/com.orientechnologies$orientdb/
?
вторник, 31 июля 2012 г., 18:27:16 UTC+3 пользователь Lvc@ написал:
Hi,
please update to latest 1.2.0-SNAPSHOT that fixed a bug on socket close in this case.

About the message "Connection re-acquired transparently after" it's normal and can happen when timeouts expire. The connection is re-acquired, so no data is lost.

Lvc@

Luca Garulli

unread,
Jul 31, 2012, 1:48:40 PM7/31/12
to orient-...@googlegroups.com, Jon S
The bug was in the server, so probably updating the server is enough, but usually it's always better to have both client and server libs aligned.

Lvc@

--
 
 
 

imikhayl

unread,
Jul 31, 2012, 2:01:09 PM7/31/12
to orient-...@googlegroups.com, Jon S
have you added Fragment-Host: com.orientechnologies.orientdb-core ? is it present at maven repository?

вторник, 31 июля 2012 г., 20:48:40 UTC+3 пользователь Lvc@ написал:
The bug was in the server, so probably updating the server is enough, but usually it's always better to have both client and server libs aligned.

Lvc@

Luca Garulli

unread,
Jul 31, 2012, 2:36:28 PM7/31/12
to orient-...@googlegroups.com, Jon S
Not yet,
that was the "release day" and unless a clean patch I couldn't risk to release something not tested. If you can provide me the patch (just change on your PC and then generate it: http://ariejan.net/2007/07/03/how-to-create-and-apply-a-patch-with-subversion/) me and all the the users can test it for a bit.

It could be deployed in short time as snapshot into the Maven Central Repository till the next official release.

Lvc@

--
 
 
 

imikhayl

unread,
Aug 1, 2012, 4:37:42 AM8/1/12
to orient-...@googlegroups.com, Jon S
the problem still presnt with the latest 1.2.0 snapshot ( 99 % of cpu without no reason) - this is after 40 threads with 400 requests

вторник, 31 июля 2012 г., 21:36:28 UTC+3 пользователь Lvc@ написал:
Not yet,
that was the "release day" and unless a clean patch I couldn't risk to release something not tested. If you can provide me the patch (just change on your PC and then generate it: http://ariejan.net/2007/07/03/how-to-create-and-apply-a-patch-with-subversion/) me and all the the users can test it for a bit.

It could be deployed in short time as snapshot into the Maven Central Repository till the next official release.

Lvc@

Luca Garulli

unread,
Aug 1, 2012, 4:43:03 AM8/1/12
to orient-...@googlegroups.com, Jon S
Him
Could you send me a thread dump of the server (is the server that takes 99% of cpu?) ?

Lvc@

--
 
 
 

imikhayl

unread,
Aug 1, 2012, 5:23:14 AM8/1/12
to orient-...@googlegroups.com, Jon S
 I just can not reproduce for now due to another error:
com.orientechnologies.common.concur.lock.OLockException: Cannot acquire lock on requested resource: remote:10.1.206.229/ecom
	com.orientechnologies.common.concur.resource.OResourcePool.getResource(OResourcePool.java:44)
	com.orientechnologies.orient.core.db.ODatabasePoolAbstract.acquire(ODatabasePoolAbstract.java:64)
	com.orientechnologies.orient.core.db.ODatabasePoolAbstract.acquire(ODatabasePoolAbstract.java:52)
	com.orientechnologies.orient.core.db.ODatabasePoolBase.acquire(ODatabasePoolBase.java:114)


среда, 1 августа 2012 г., 11:43:03 UTC+3 пользователь Lvc@ написал:
Him
Could you send me a thread dump of the server (is the server that takes 99% of cpu?) ?

Lvc@

imikhayl

unread,
Aug 1, 2012, 5:24:40 AM8/1/12
to orient-...@googlegroups.com, Jon S
this is on the client(


среда, 1 августа 2012 г., 11:43:03 UTC+3 пользователь Lvc@ написал:
Him
Could you send me a thread dump of the server (is the server that takes 99% of cpu?) ?

Lvc@

Luca Garulli

unread,
Aug 1, 2012, 5:37:28 AM8/1/12
to orient-...@googlegroups.com, Jon S
It's a problem opening the database but it's not a timeout. Probably the server is down or there are connection problems between client and server?

Lvc@

--
 
 
 

imikhayl

unread,
Aug 1, 2012, 5:41:49 AM8/1/12
to orient-...@googlegroups.com, Jon S
but the server is up( I have checked it(

среда, 1 августа 2012 г., 12:37:28 UTC+3 пользователь Lvc@ написал:
It's a problem opening the database but it's not a timeout. Probably the server is down or there are connection problems between client and server?

Lvc@

imikhayl

unread,
Aug 1, 2012, 5:42:44 AM8/1/12
to orient-...@googlegroups.com, Jon S
and connection is ok(

среда, 1 августа 2012 г., 12:37:28 UTC+3 пользователь Lvc@ написал:
It's a problem opening the database but it's not a timeout. Probably the server is down or there are connection problems between client and server?

Lvc@

imikhayl

unread,
Aug 1, 2012, 5:46:13 AM8/1/12
to orient-...@googlegroups.com, Jon S
I have restarted the server it works again...( so the pool reinitializes... might be sinchronization problem?
by the way does your jenkins still working& I cannot connect to here: datastorm.com.ua/jenkins/job/orient-svn-maven/

среда, 1 августа 2012 г., 12:37:28 UTC+3 пользователь Lvc@ написал:
It's a problem opening the database but it's not a timeout. Probably the server is down or there are connection problems between client and server?

Lvc@

Luca Garulli

unread,
Aug 1, 2012, 5:50:00 AM8/1/12
to orient-...@googlegroups.com, Jon S
That server is managed by Andrey. Probably it's down for maintenance.

Lvc@

--
 
 
 

imikhayl

unread,
Aug 1, 2012, 5:50:33 AM8/1/12
to orient-...@googlegroups.com, Jon S
forget to mention another case (not present it the case i mentioned before)... when orient server is restarted the pool can not reaqure the connection(

среда, 1 августа 2012 г., 12:37:28 UTC+3 пользователь Lvc@ написал:
It's a problem opening the database but it's not a timeout. Probably the server is down or there are connection problems between client and server?

Lvc@

Luca Garulli

unread,
Aug 1, 2012, 5:55:49 AM8/1/12
to orient-...@googlegroups.com, Jon S
Are you using latest release?

Lvc@

--
 
 
 

imikhayl

unread,
Aug 1, 2012, 6:14:11 AM8/1/12
to orient-...@googlegroups.com, Jon S
yes. I downloaded it from jenkins yesterday. so far i can not reproduce cpu problem (mignt be yesterday i was using old client libs - so the client update also neeed (not only the server)).
but performance became much worse.. / with a lot of  WARNING: Connection re-acquired transparently after 507ms and 1 retries: no errors will be thrown at application level
(it takes time)/ also i have noticed that even in a filter (which aquires connection only ones for business flow) method aquire takes a lot of time (I think it should not)
also for this release i can not stop datatbase with scrept orient.sh... so I have to kill java process(

среда, 1 августа 2012 г., 12:55:49 UTC+3 пользователь Lvc@ написал:
Are you using latest release?

Lvc@

Luca Garulli

unread,
Aug 1, 2012, 6:40:07 AM8/1/12
to orient-...@googlegroups.com, Jon S
Hi,
you're running with default settings and timeouts fire up causing a close + reacquire of physical TCP/IP connection. This is expensive!


Lvc@

--
 
 
 

imikhayl

unread,
Aug 1, 2012, 6:52:44 AM8/1/12
to orient-...@googlegroups.com, Jon S
ok, could you please tell me what settings should I use?

среда, 1 августа 2012 г., 13:40:07 UTC+3 пользователь Lvc@ написал:
Hi,
you're running with default settings and timeouts fire up causing a close + reacquire of physical TCP/IP connection. This is expensive!


Lvc@

imikhayl

unread,
Aug 1, 2012, 7:32:23 AM8/1/12
to orient-...@googlegroups.com, Jon S
-Dstorage.record.lockTimeout=5120000
and
-Dnetwork.lockTimeout=5120000
are these correct ones?

среда, 1 августа 2012 г., 13:40:07 UTC+3 пользователь Lvc@ написал:
Hi,
you're running with default settings and timeouts fire up causing a close + reacquire of physical TCP/IP connection. This is expensive!


Lvc@

Luca Garulli

unread,
Aug 1, 2012, 9:07:50 AM8/1/12
to orient-...@googlegroups.com, Jon S
Hi,
yes, use also -1 to disable them.

Lvc@

--
 
 
 

imikhayl

unread,
Aug 1, 2012, 10:01:38 AM8/1/12
to orient-...@googlegroups.com, Jon S
should I set it for both client and server?

среда, 1 августа 2012 г., 16:07:50 UTC+3 пользователь Lvc@ написал:
Hi,
yes, use also -1 to disable them.

Lvc@

Luca Garulli

unread,
Aug 1, 2012, 10:11:01 AM8/1/12
to orient-...@googlegroups.com, Jon S
Only in client.

Lvc@

--
 
 
 

imikhayl

unread,
Aug 1, 2012, 10:46:28 AM8/1/12
to orient-...@googlegroups.com, Jon S
Colud you terll me, How to quick remove class with many clasters?

среда, 1 августа 2012 г., 17:11:01 UTC+3 пользователь Lvc@ написал:
Only in client.

Lvc@

Luca Garulli

unread,
Aug 1, 2012, 10:56:58 AM8/1/12
to orient-...@googlegroups.com, Jon S
You want to remove the class from the schema or also the record?

use:

> truncate class X

to remove all the record of a class.
Lvc@

--
 
 
 

imikhayl

unread,
Aug 1, 2012, 1:21:05 PM8/1/12
to orient-...@googlegroups.com, Jon S
the Class whic in turns conains a lot of clusters/ currently i'm using delete statement and then drop class (it tooks time) but clusters stil remains anfd there are some errors during recreation (to put it briefly i need sometimes recreate large tables(in your turms - classes which in turns divided into clusters) and i need fast way to do such a thing.

среда, 1 августа 2012 г., 17:56:58 UTC+3 пользователь Lvc@ написал:
You want to remove the class from the schema or also the record?

use:

> truncate class X

to remove all the record of a class.
Lvc@

Luca Garulli

unread,
Aug 1, 2012, 6:57:44 PM8/1/12
to orient-...@googlegroups.com, Jon S
If a class relies on multiple clusters you have to drop them manually:

- drop cluster xxx

Lvc@

--
 
 
 

imikhayl

unread,
Aug 2, 2012, 3:32:42 AM8/2/12
to orient-...@googlegroups.com, Jon S
I need a way to drop these by java api

четверг, 2 августа 2012 г., 1:57:44 UTC+3 пользователь Lvc@ написал:
If a class relies on multiple clusters you have to drop them manually:

- drop cluster xxx

Lvc@

imikhayl

unread,
Aug 2, 2012, 3:34:07 AM8/2/12
to orient-...@googlegroups.com, Jon S
i mean do you have only sql way to do such a thing?


четверг, 2 августа 2012 г., 1:57:44 UTC+3 пользователь Lvc@ написал:
If a class relies on multiple clusters you have to drop them manually:

- drop cluster xxx

Lvc@

Luca Garulli

unread,
Aug 2, 2012, 7:15:41 AM8/2/12
to orient-...@googlegroups.com, Jon S
Hi,
look at the Java classes:

db.dropCluster()

Lvc@

--
 
 
 

imikhayl

unread,
Aug 2, 2012, 10:33:37 AM8/2/12
to orient-...@googlegroups.com, Jon S
in case i use only delete (without removing cluster):
 [2012-08-02 14:28:22.184] edulerFactoryBean#0_Worker-1 System.err                                                        com.orientechnologies.orient.core.exception.ODatabaseException: Error on retrieving record #174:899 (clus
ter: binlistwhite63)
[2012-08-02 14:28:22.184] edulerFactoryBean#0_Worker-1 System.err                                                               at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[2012-08-02 14:28:22.184] edulerFactoryBean#0_Worker-1 System.err                                                               at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
[2012-08-02 14:28:22.185] edulerFactoryBean#0_Worker-1 System.err                                                               at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.jav
a:27)
[2012-08-02 14:28:22.185] edulerFactoryBean#0_Worker-1 System.err                                                               at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
[2012-08-02 14:28:22.185] edulerFactoryBean#0_Worker-1 System.err                                                               at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.createException(OChannelB
inary.java:427)
[2012-08-02 14:28:22.185] edulerFactoryBean#0_Worker-1 System.err                                                               at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.handleStatus(OChannelBina
ry.java:382)
[2012-08-02 14:28:22.185] edulerFactoryBean#0_Worker-1 System.err                                                               at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynch.beginResponse(OChan
nelBinaryAsynch.java:142)
[2012-08-02 14:28:22.185] edulerFactoryBean#0_Worker-1 System.err                                                               at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynch.beginResponse(OChan
nelBinaryAsynch.java:57)
[2012-08-02 14:28:22.185] edulerFactoryBean#0_Worker-1 System.err                                                               at com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(OStorageRemote.java:155
6)
[2012-08-02 14:28:22.185] edulerFactoryBean#0_Worker-1 System.err                                                               at com.orientechnologies.orient.client.remote.OStorageRemote.command(OStorageRemote.java:727)
[2012-08-02 14:28:22.185] edulerFactoryBean#0_Worker-1 System.err                                                               at com.orientechnologies.orient.client.remote.OStorageRemoteThread.command(OStorageRemoteThread.ja
va:191)
[2012-08-02 14:28:22.185] edulerFactoryBean#0_Worker-1 System.err                                                               at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTe
xtAbstract.java:60)
[2012-08-02 14:28:22.185] edulerFactoryBean#0_Worker-1 System.err                                                               at com.orientechnologies.orient.object.db.OCommandSQLPojoWrapper.execute(OCommandSQLPojoWrapper.ja
va:44)
[2012-08-02 14:28:22.187] edulerFactoryBean#0_Worker-1 System.err                                                        Caused by: com.orientechnologies.orient.core.exception.OStorageException: Error on reading record from file 'default.0.oda', position 185548729, size 1,10Gb: the record size is bigger then the file itself (193,90Mb). Probably the record is dirty due to a previous crash. It is strongly suggested to restore the database or export and reimport this one.
[2012-08-02 14:28:22.188] edulerFactoryBean#0_Worker-1 System.err                                                               at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[2012-08-02 14:28:22.188] edulerFactoryBean#0_Worker-1 System.err                                                               at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
[2012-08-02 14:28:22.188] edulerFactoryBean#0_Worker-1 System.err                                                               at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
[2012-08-02 14:28:22.188] edulerFactoryBean#0_Worker-1 System.err                                                               at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
[2012-08-02 14:28:22.188] edulerFactoryBean#0_Worker-1 System.err                                                               at com.orientechnologies.o


четверг, 2 августа 2012 г., 14:15:41 UTC+3 пользователь Lvc@ написал:
Hi,
look at the Java classes:

db.dropCluster()

Lvc@

Luca Garulli

unread,
Aug 2, 2012, 10:50:44 AM8/2/12
to orient-...@googlegroups.com, Jon S
Hi,
seems that something was broken on references. What release are you using?

Lvc@

--
 
 
 

imikhayl

unread,
Aug 2, 2012, 11:12:41 AM8/2/12
to orient-...@googlegroups.com, Jon S
1.2.0 snapshot ( I have not change it since last time - but this error is reproducible in each). when your are creating and filling at first time sems ok. then i did huge queries with select insert at my logic flow. at next step i tried to update table and got such error.

четверг, 2 августа 2012 г., 17:50:44 UTC+3 пользователь Lvc@ написал:
Hi,
seems that something was broken on references. What release are you using?

Lvc@

imikhayl

unread,
Aug 2, 2012, 11:15:43 AM8/2/12
to orient-...@googlegroups.com, Jon S
must notice that insert and select are not related with the table i'm going to update.

четверг, 2 августа 2012 г., 17:50:44 UTC+3 пользователь Lvc@ написал:
Hi,
seems that something was broken on references. What release are you using?

Lvc@

imikhayl

unread,
Aug 3, 2012, 4:59:12 AM8/3/12
to orient-...@googlegroups.com, Jon S
Hi, here the problem I'm facing too often on each version:
  com.orientechnologies.orient.core.exception.ODatabaseException: Error on retrieving record #59:1933 (cluster: ipcountry50)
[2012-08-03 11:54:26.640] edulerFactoryBean#0_Worker-1 System.err                                                            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[2012-08-03 11:54:26.640] edulerFactoryBean#0_Worker-1 System.err                                                            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
[2012-08-03 11:54:26.641] edulerFactoryBean#0_Worker-1 System.err                                                            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
[2012-08-03 11:54:26.641] edulerFactoryBean#0_Worker-1 System.err                                                            at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
[2012-08-03 11:54:26.641] edulerFactoryBean#0_Worker-1 System.err                                                            at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.createException(OChannelBinary.java:427)
[2012-08-03 11:54:26.642] edulerFactoryBean#0_Worker-1 System.err                                                            at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.handleStatus(OChannelBinary.java:382)
[2012-08-03 11:54:26.642] edulerFactoryBean#0_Worker-1 System.err                                                            at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynch.beginResponse(OChannelBinaryAsynch.java:145)
[2012-08-03 11:54:26.643] edulerFactoryBean#0_Worker-1 System.err                                                            at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynch.beginResponse(OChannelBinaryAsynch.java:59)
[2012-08-03 11:54:26.643] edulerFactoryBean#0_Worker-1 System.err                                                            at com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(OStorageRemote.java:1556)
[2012-08-03 11:54:26.644] edulerFactoryBean#0_Worker-1 System.err                                                            at com.orientechnologies.orient.client.remote.OStorageRemote.command(OStorageRemote.java:727)
[2012-08-03 11:54:26.644] edulerFactoryBean#0_Worker-1 System.err                                                            at com.orientechnologies.orient.client.remote.OStorageRemoteThread.command(OStorageRemoteThread.java:191)
[2012-08-03 11:54:26.644] edulerFactoryBean#0_Worker-1 System.err                                                            at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTextAbstract.java:60)
[2012-08-03 11:54:26.645] edulerFactoryBean#0_Worker-1 System.err                                                            at com.orientechnologies.orient.object.db.OCommandSQLPojoWrapper.execute(OCommandSQLPojoWrapper.java:44)
  Caused by: com.orientechnologies.orient.core.exception.OStorageException: Error on reading record from file 'default.0.oda', position 103071798, size 771,01Mb: the record size is bigger then the file itself (125,12Mb). Probably the record is dirty due to a previous crash. It is strongly suggested to restore the database or export and reimport this one.
[2012-08-03 11:54:26.649] edulerFactoryBean#0_Worker-1 System.err                                                            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[2012-08-03 11:54:26.650] edulerFactoryBean#0_Worker-1 System.err                                                            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
[2012-08-03 11:54:26.650] edulerFactoryBean#0_Worker-1 System.err                                                            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
[2012-08-03 11:54:26.651] edulerFactoryBean#0_Worker-1 System.err                                                            at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
[2012-08-03 11:54:26.651] edulerFactoryBean#0_Worker-1 System.err                                                            at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.createException(OChannelBinary.java:429)


I have table ipcountry with 200000 records at runtime i do huge selects. in case i want remove records i do simple "delete query" and got such error.

четверг, 2 августа 2012 г., 17:50:44 UTC+3 пользователь Lvc@ написал:
Hi,
seems that something was broken on references. What release are you using?

Lvc@

imikhayl

unread,
Aug 3, 2012, 5:01:49 AM8/3/12
to orient-...@googlegroups.com, Jon S
this is the table with 100 clusters.

четверг, 2 августа 2012 г., 17:50:44 UTC+3 пользователь Lvc@ написал:
Hi,
seems that something was broken on references. What release are you using?

Lvc@

imikhayl

unread,
Aug 3, 2012, 5:04:19 AM8/3/12
to orient-...@googlegroups.com, Jon S
structure as follows:
private Long numFrom;
    private Long numTo;
    private String numCode;

четверг, 2 августа 2012 г., 17:50:44 UTC+3 пользователь Lvc@ написал:
Hi,
seems that something was broken on references. What release are you using?

Lvc@

imikhayl

unread,
Aug 3, 2012, 7:20:52 AM8/3/12
to orient-...@googlegroups.com, Jon S
another exception(1.2.0):
com.orientechnologies.orient.core.exception.OStorageException: Cannot delete the remote storage: ecom
[2012-08-03 14:16:33.337] region-dm-10                 System.err                                                            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[2012-08-03 14:16:33.337] region-dm-10                 System.err                                                            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
[2012-08-03 14:16:33.338] region-dm-10                 System.err                                                            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
[2012-08-03 14:16:33.338] region-dm-10                 System.err                                                            at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
[2012-08-03 14:16:33.339] region-dm-10                 System.err                                                            at com.orientechnologies.common.log.OLogManager.exception(OLogManager.java:157)
[2012-08-03 14:16:33.339] region-dm-10                 System.err                                                            at com.orientechnologies.orient.client.remote.OServerAdmin.dropDatabase(OServerAdmin.java:264)
Caused by: com.orientechnologies.common.concur.OTimeoutException: Cannot acquire read lock against channel: /xxxxxxx:2424
[2012-08-03 14:16:33.361] region-dm-10                 System.err                                                            at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynch.beginResponse(OChannelBinaryAsynch.java:72)
[2012-08-03 14:16:33.362] region-dm-10                 System.err                                                            at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynch.beginResponse(OChannelBinaryAsynch.java:59)
[2012-08-03 14:16:33.363] region-dm-10                 System.err                                                            at com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(OStorageRemote.java:1556)
[2012-08-03 14:16:33.363] region-dm-10                 System.err                                                            at com.orientechnologies.orient.client.remote.OStorageRemote.getResponse(OStorageRemote.java:1587)
[2012-08-03 14:16:33.365] region-dm-10                 System.err                                                            at com.orientechnologies.orient.client.remote.OServerAdmin.dropDatabase(OServerAdmin.java:259)
[2012-08-03 14:16:33.365] region-dm-10                 System.err                                                            ... 26 more


четверг, 2 августа 2012 г., 17:50:44 UTC+3 пользователь Lvc@ написал:
Hi,
seems that something was broken on references. What release are you using?

Lvc@

imikhayl

unread,
Aug 3, 2012, 8:23:55 AM8/3/12
to orient-...@googlegroups.com, Jon S
aused by: com.orientechnologies.orient.core.exception.OStorageException: Error while removing cluster '6'
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.createException(OChannelBinary.java:427)
    at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.handleStatus(OChannelBinary.java:382)
    at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynch.beginResponse(OChannelBinaryAsynch.java:145)
    at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynch.beginResponse(OChannelBinaryAsynch.java:59)
    at com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(OStorageRemote.java:1556)
    at com.orientechnologies.orient.client.remote.OStorageRemote.command(OStorageRemote.java:727)
    at com.orientechnologies.orient.client.remote.OStorageRemoteThread.command(OStorageRemoteThread.java:191)
    at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTextAbstract.java:60)
    at com.orientechnologies.orient.core.metadata.schema.OSchemaShared.dropClass(OSchemaShared.java:324)
    at com.orientechnologies.orient.core.metadata.schema.OSchemaProxy.dropClass(OSchemaProxy.java:105)
Caused by: java.lang.IllegalStateException: Corrupted holes: found offset 13279213 instead of 13132817 while creating a new hole on position 13279139, size 60. The closest hole 89 points to position 13132817, size 146922
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.createException(OChannelBinary.java:429)
    ... 37 common frames omitted


четверг, 2 августа 2012 г., 17:50:44 UTC+3 пользователь Lvc@ написал:
Hi,
seems that something was broken on references. What release are you using?

Lvc@

imikhayl

unread,
Aug 3, 2012, 9:14:15 AM8/3/12
to orient-...@googlegroups.com, Jon S
2012-08-03 12:47:29.798] region-dm-11                 System.err                                                        Caused by: com.orientechnologies.orient.core.exception.OStorageException: Error in creation of new cluster 'cardcoun
t713' of type: PHYSICAL
[2012-08-03 12:47:29.798] region-dm-11                 System.err                                                               at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[2012-08-03 12:47:29.798] region-dm-11                 System.err                                                               at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
[2012-08-03 12:47:29.798] region-dm-11                 System.err                                                               at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
[2012-08-03 12:47:29.798] region-dm-11                 System.err                                                               at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
[2012-08-03 12:47:29.798] region-dm-11                 System.err                                                               at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.createException(OChannelBinary.java:
427)
[2012-08-03 12:47:29.798] region-dm-11                 System.err                                                               at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.handleStatus(OChannelBinary.java:382
)
[2012-08-03 12:47:29.798] region-dm-11                 System.err                                                               at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynch.beginResponse(OChannelBinaryAs
ynch.java:145)
[2012-08-03 12:47:29.798] region-dm-11                 System.err                                                               at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynch.beginResponse(OChannelBinaryAs
ynch.java:59)
[2012-08-03 12:47:29.799] region-dm-11                 System.err                                                               at com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(OStorageRemote.java:1556)
[2012-08-03 12:47:29.799] region-dm-11                 System.err                                                               at com.orientechnologies.orient.client.remote.OStorageRemote.addCluster(OStorageRemote.java:972)
[2012-08-03 12:47:29.799] region-dm-11                 System.err                                                               at com.orientechnologies.orient.client.remote.OStorageRemoteThread.addCluster(OStorageRemoteThread.java:227)
[2012-08-03 12:47:29.799] region-dm-11                 System.err                                                               at com.orientechnologies.orient.core.db.raw.ODatabaseRaw.addCluster(ODatabaseRaw.java:353)
[2012-08-03 12:47:29.799] region-dm-11                 System.err                                                               at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.addCluster(ODatabaseWrapperAbstract.java:187
)
[2012-08-03 12:47:29.799] region-dm-11                 System.err                                                               at com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.addCluster(ODatabaseWrapperAbstract.java:187
)
[2012-08-03 12:47:29.799] region-dm-11                 System.err                                                               at com.orientechnologies.orient.core.db.ODatabaseRecordWrapperAbstract.addCluster(ODatabaseRecordWrapperAbstr

[2012-08-03 12:47:29.801] region-dm-11                 System.err                                                        Caused by: com.orientechnologies.common.exception.OException: java.io.FileNotFoundException: /opt/orient/databases/e
com/cardcount713.0.ocl
[2012-08-03 12:47:29.801] region-dm-11                 System.err                                                               at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.createException(OChannelBinary.java:
434)
[2012-08-03 12:47:29.801] region-dm-11                 System.err                                                               ... 38 more
[2012-08-03 12:47:29.801] region-dm-11                 System.err                                                        Caused by: java.io.FileNotFoundException: /opt/orient/databases/ecom/cardcount713.0.ocl
[2012-08-03 12:47:29.801] region-dm-11                 System.err                                                               at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[2012-08-03 12:47:29.801] region-dm-11                 System.err                                                               at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
[2012-08-03 12:47:29.801] region-dm-11                 System.err                                                               at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
[2012-08-03 12:47:29.801] region-dm-11                 System.err                                                               at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
[2012-08-03 12:47:29.802] region-dm-11                 System.err                                                               at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.createException(OChannelBinary.java:
429)
[2012-08-03 12:47:29.802] region-dm-11                 System.err                                                               ... 38 more

четверг, 2 августа 2012 г., 17:50:44 UTC+3 пользователь Lvc@ написал:
Hi,
seems that something was broken on references. What release are you using?

Lvc@
Reply all
Reply to author
Forward
0 new messages