Hi Luca,

Could you please clarify more details for Caching, including the difference 
between Level 1 and Level 2 cache? I read the 
http://orientdb.com/docs/last/Caching.html, and found it is not clear to 
describe the several cache mechanisms in OrientDB, but I found another wiki 
@ https://github.com/sslavic/orientdb-wiki/blob/master/Caching.md, it told 
me more about caching, but I don't know it is workable for the latest 
OrientDB version, such as 2.2.xx, because I am investigating the CME issues 
in OrientDB 2.2.12.   

Thank you very much,

Zhiqiang


在 2012年6月19日星期二 UTC+8上午2:49:31,Lvc@写道:
>
> Hi,
> 1)  http://code.google.com/p/orient/wiki/Caching 
> 2) usually yes: if the mvcc breaks means you could work on old records
>
> Lvc@
>
> On 18 June 2012 20:44, Yanxin <[email protected] <javascript:>> wrote:
>
>> Thank you so much, Luca. 
>> Several questions:) 
>> 1) What is the purpose of cache level 1 and level 2? 
>> 2) should I enable mvcc when I run my java program? 
>>
>>
>> On Monday, June 18, 2012 1:46:23 AM UTC-7, Lvc@ wrote:
>>>
>>> Hi,
>>> you should disable the mvcc in the server side too. However usually 
>>> disabling mvcc is not a good solution because you could update not last 
>>> version loosing changes.
>>>
>>> On high concurrency scenario the best is:
>>>
>>>    1. disable level2 cache on clients (in the 1.1 or 1.2 we'll have a 
>>>    distributed level2 cache)
>>>    2. force reloading of vertexes in case of concurrency exception. 
>>>    Example:
>>>
>>> // 10 is the max retry here
>>> for( int i = 0; i < 10; ++i ){
>>>   try{
>>>     // APPLY YOUR CHANGES
>>>     db.createEdge( v1, v2 );
>>>   } catch( OConcurrentModificationException e ){
>>>     // RELOAD VERTEXES
>>>     v1.reload();
>>>     v2.reload(); 
>>>   }
>>> }
>>>
>>> Lvc@
>>>
>>> On 17 June 2012 09:02, Yanxin <[email protected] <javascript:>> wrote:
>>>
>>>> Hello, 
>>>> I have a program to insert record into OrientDB, which use timestamp as 
>>>> input parameters. 
>>>> Originallly when I run the program, it will stops in the middle and 
>>>> report "com.orientechnologies.orient.core.exception.
>>>> OConcurrentModificationException" error. 
>>>> I google it and find the solution, which disable level1 cache and mvcc. 
>>>> This solve my problem. 
>>>> For example, 
>>>> java -Dcache.level1.enabled=false -Ddb.mvcc=false UpdateGraph 
>>>> 2012-06-01 2012-0614
>>>>
>>>> I have run it for a week without the problem. 
>>>>
>>>> However, I have another question now. I need to run the program to 
>>>> update graph in different days at the same time so that I can speed up my 
>>>> progress, for example, I need to run 
>>>> java -Dcache.level1.enabled=false -Ddb.mvcc=false UpdateGraph 
>>>> 2012-06-13 2012-0614
>>>> java -Dcache.level1.enabled=false -Ddb.mvcc=false UpdateGraph 
>>>> 2012-06-14 2012-0615
>>>>
>>>> at the same time. The issue is when I start second process, the first 
>>>> one terminated with the same error as before "com.orientechnologies.orient.
>>>> core.exception.OConcurrentModificationException". 
>>>>
>>>> Could anyone help me to solve the issue?
>>>> Thanks a lot.
>>>> Yanxin
>>>>
>>>>
>>>> Exception in thread "main" com.orientechnologies.orient.core.exception.
>>>> OConcurrentModificationException: Cannot update record #14:69 in 
>>>> storage 'graph' because the version is not the latest. Probably you are 
>>>> updating an old record or it has been modified by another user (db=v81 
>>>> your=v80)
>>>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
>>>> Method)
>>>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(
>>>> NativeConstructorAccessorImpl.java:57)
>>>>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
>>>> DelegatingConstructorAccessorImpl.java:45)
>>>>         at java.lang.reflect.Constructor.newInstance(Constructor.java:
>>>> 532)
>>>>         at com.orientechnologies.orient.enterprise.channel.binary.
>>>> OChannelBinary.createException(OChannelBinary.java:411)
>>>>         at com.orientechnologies.orient.enterprise.channel.binary.
>>>> OChannelBinary.handleStatus(OChannelBinary.java:364)
>>>>         at com.orientechnologies.orient.enterprise.channel.binary.
>>>> OChannelBinaryAsynch.beginResponse(OChannelBinaryAsynch.java:145)
>>>>         at com.orientechnologies.orient.enterprise.channel.binary.
>>>> OChannelBinaryAsynch.beginResponse(OChannelBinaryAsynch.java:60)
>>>>         at com.orientechnologies.orient.client.remote.OStorageRemote.
>>>> beginResponse(OStorageRemote.java:1492)
>>>>         at com.orientechnologies.orient.client.remote.OStorageRemote.
>>>> updateRecord(OStorageRemote.java:445)
>>>>         at com.orientechnologies.orient.client.remote.
>>>> OStorageRemoteThread.updateRecord(OStorageRemoteThread.java:151)
>>>>         at com.orientechnologies.orient.core.db.raw.ODatabaseRaw.save(
>>>> ODatabaseRaw.java:243)
>>>>         at com.orientechnologies.orient.core.db.record.
>>>> ODatabaseRecordAbstract.executeSaveRecord(ODatabaseRecordAbstract.java:
>>>> 662)
>>>>         at com.orientechnologies.orient.core.tx.OTransactionNoTx.
>>>> saveRecord(OTransactionNoTx.java:72)
>>>>         at com.orientechnologies.orient.core.db.record.
>>>> ODatabaseRecordTx.save(ODatabaseRecordTx.java:221)
>>>>         at com.orientechnologies.orient.core.db.record.
>>>> ODatabaseRecordTx.save(ODatabaseRecordTx.java:214)
>>>>         at com.orientechnologies.orient.core.db.record.
>>>> ODatabaseRecordTx.save(ODatabaseRecordTx.java:35)
>>>>         at com.orientechnologies.orient.core.serialization.serializer.
>>>> record.string.ORecordSerializerCSVAbstract.linkToStream(
>>>> ORecordSerializerCSVAbstract.java:739)
>>>>         at com.orientechnologies.orient.core.serialization.serializer.
>>>> record.string.ORecordSerializerCSVAbstract.fieldToStream(
>>>> ORecordSerializerCSVAbstract.java:246)
>>>>         at com.orientechnologies.orient.core.serialization.serializer.
>>>> record.string.ORecordSerializerSchemaAware2CSV.toString(
>>>> ORecordSerializerSchemaAware2CSV.java:242)
>>>>         at com.orientechnologies.orient.core.serialization.serializer.
>>>> record.string.ORecordSerializerStringAbstract.toStream(
>>>> ORecordSerializerStringAbstract.java:80)
>>>>         at com.orientechnologies.orient.core.record.
>>>> ORecordSchemaAwareAbstract.toStream(ORecordSchemaAwareAbstract.
>>>> java:118)
>>>>         at com.orientechnologies.orient.core.record.
>>>> ORecordSchemaAwareAbstract.toStream(ORecordSchemaAwareAbstract.
>>>> java:113)
>>>>         at com.orientechnologies.orient.core.db.record.
>>>> ODatabaseRecordAbstract.executeSaveRecord(ODatabaseRecordAbstract.java:
>>>> 616)
>>>>         at com.orientechnologies.orient.core.tx.OTransactionNoTx.
>>>> saveRecord(OTransactionNoTx.java:72)
>>>>         at com.orientechnologies.orient.core.db.record.
>>>> ODatabaseRecordTx.save(ODatabaseRecordTx.java:221)
>>>>         at com.orientechnologies.orient.core.db.record.
>>>> ODatabaseRecordTx.save(ODatabaseRecordTx.java:214)
>>>>         at com.orientechnologies.orient.core.db.record.
>>>> ODatabaseRecordTx.save(ODatabaseRecordTx.java:35)
>>>>         at com.orientechnologies.orient.core.record.ORecordAbstract.
>>>> save(ORecordAbstract.java:269)
>>>>         at com.orientechnologies.orient.core.record.impl.ODocument.
>>>> save(ODocument.java:1233)
>>>>         at com.orientechnologies.orient.core.record.impl.ODocument.
>>>> save(ODocument.java:1222)
>>>>         at com.orientechnologies.orient.core.record.impl.ODocument.
>>>> save(ODocument.java:69)
>>>>         at com.orientechnologies.orient.core.type.tree.OMVRBTreeRID.
>>>> saveAllNewEntries(OMVRBTreeRID.java:364)
>>>>         at com.orientechnologies.orient.core.type.tree.OMVRBTreeRID.
>>>> commitChanges(OMVRBTreeRID.java:307)
>>>>         at com.orientechnologies.orient.core.type.tree.
>>>> OMVRBTreePersistent.put(OMVRBTreePersistent.java:474)
>>>>         at com.orientechnologies.orient.core.type.tree.
>>>> OMVRBTreeRIDSet.add(OMVRBTreeRIDSet.java:109)
>>>>         at com.orientechnologies.orient.core.db.graph.OGraphDatabase.
>>>> createEdge(OGraphDatabase.java:275)
>>>>         at com.orientechnologies.orient.core.db.graph.OGraphDatabase.
>>>> createEdge(OGraphDatabase.java:244)
>>>>
>>>>
>>>
>

-- 

--- 
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