Re: [orientdb] NoSuchMethodError & NullPointerExceptio with Tinkerpop (orientdb-graphed versions 1.3.0/1.4.0)

201 views
Skip to first unread message

Luca Garulli

unread,
May 8, 2013, 11:53:58 AM5/8/13
to orient-database
Hi Manas,
that issue was fixed days ago and it's in the main branch. I suggest you to get latest orientdb 1.4.0 by:

> cd orientdb
> ant clean installg

You will find your fresh OrientDB Graph Edition 1.4.0-SNAPSHOT in directory ../releases/orientdb-graphed-1.4.0-SNAPSHOT

Lvc@




On 8 May 2013 14:38, Manas <manas...@gmail.com> wrote:
Hi,

I was trying with orientdb-graphed-1.3.0 to construct a graph using the Tinkerpop/Blueprints APIs. However I hit the issue as explained in https://github.com/nuvolabase/orientdb/issues/1167. So I moved to orientdb-graphed-1.4.0-SNAPSHOT. With this now I am not hitting the earlier java.lang.NoSuchMethodError issue but this time hitting a java.lang.NullPointerException:

Caused by: java.lang.NullPointerException
    at com.tinkerpop.blueprints.impls.orient.OrientVertex.deleteEdgeIfAny(OrientVertex.java:617)
    at com.tinkerpop.blueprints.impls.orient.OrientVertex.removeEdges(OrientVertex.java:610)
    at com.tinkerpop.blueprints.impls.orient.OrientVertex.remove(OrientVertex.java:156)
    at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.removeVertex(OrientBaseGraph.java:266)

When I peeked into the OrientVertex.removeEdges implementation; noticed following:

public static void removeEdges(ODocument iVertex, String iFieldName, OIdentifiable iVertexToRemove, boolean iAlsoInverse, boolean useVertexFieldsForEdgeLabels)
  {
    //...some code

    if ((fieldValue instanceof OIdentifiable))
    {
        //...some code
    }
    else if ((fieldValue instanceof OMVRBTreeRIDSet))
    {
      if (iVertexToRemove != null) {
         //...some code
      }
      else
      {
        /*
        NOTE: We are here that means iVertexToRemove is null (OrientVertex.removeEdges is being called from OrientVertex.remove passing null as the value for iVertexToRemove). So passing that null iVertexToRemove into deleteEdgeIfAny below is causing the NLP within deleteEdgeIfAny at the line ODocument doc = (ODocument)iRecord.getRecord().
        */
        for (it = ((OMVRBTreeRIDSet)fieldValue).iterator(false); it.hasNext(); )
          deleteEdgeIfAny(iVertexToRemove);
      }
    }
  }

Could this be fixed and some patch provided? We are evaluating OrientDB for a POC and this issue is blocking us from proceeding further.

Thanks much,
Manas

--
 
---
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 orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Luca Garulli

unread,
May 10, 2013, 2:24:37 AM5/10/13
to orient-database



On 10 May 2013 05:14, Manas <manas...@gmail.com> wrote:
Hi Luca,

Thanks much for the quick reply.We followed your suggestion and the earlier mentioned NPE is gone. However this time we are hitting 3 other exceptions:

1) com.orientechnologies.orient.
core.exception.OConcurrentModificationException
2) com.orientechnologies.orient.core.exception.ODatabaseException
3) a new NPE.

The stack traces are mentioned below. We are hitting these exceptions thru some TestNG tests (all single threaded); so not quite sure why the first one viz OConcurrentModificationException is occurring. Yet we tried to follow the solution for that one as mentioned here: https://groups.google.com/forum/#!msg/orient-database/dIE0idnVKmI/0geXbIs_mZEJ by disabling level1 cache and mvcc by adding following into orientdb-server-config.xml:
    <properties>
    <entry name="db.mvcc" value="false"/>
    <entry name="cache.level1.enabled" value="false"/>       
    </properties>
Don't disable MVCC. There must be a reason why that exception is raised. Disabling MVCC means you could have a dirty database on concurrent usage.
 
However that didn’t fix the issue. The 3 exceptions are not occurring all the time. Sometime all the TestNG tests pass whereas sometime arbitrarily couple of them fails with above exceptions. We are using local file based OrientDB in embedded mode. Any help/pointer is resolving these would be greatly appreciated. Here are the stack traces:

Exception_1:
com.orientechnologies.orient.core.exception.OConcurrentModificationException: Cannot DELETE the record #9:147 because the version is not the latest. Probably you are deleting an old record or it has been modified by another user (db=v5 your=v6)
    at com.orientechnologies.orient.core.storage.impl.local.OStorageLocal.deleteRecord(OStorageLocal.java:1943)
    at com.orientechnologies.orient.core.storage.impl.local.OStorageLocalTxExecuter.deleteRecord(OStorageLocalTxExecuter.java:152)
    at com.orientechnologies.orient.core.storage.impl.local.OStorageLocalTxExecuter.commitEntry(OStorageLocalTxExecuter.java:304)
    at com.orientechnologies.orient.core.storage.impl.local.OStorageLocalTxExecuter.commitAllPendingRecords(OStorageLocalTxExecuter.java:184)
    at com.orientechnologies.orient.core.storage.impl.local.OStorageLocal.commit(OStorageLocal.java:1302)
    at com.orientechnologies.orient.core.tx.OTransactionOptimistic$2.call(OTransactionOptimistic.java:123)
    at com.orientechnologies.orient.core.tx.OTransactionOptimistic$2.call(OTransactionOptimistic.java:119)
    at com.orientechnologies.orient.core.storage.OStorageAbstract.callInLock(OStorageAbstract.java:168)
    at com.orientechnologies.orient.core.storage.impl.local.OStorageLocal.callInLock(OStorageLocal.java:1114)
    at com.orientechnologies.orient.core.tx.OTransactionOptimistic.commit(OTransactionOptimistic.java:119)
    at com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.commit(ODatabaseRecordTx.java:113)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:454)
    at com.tinkerpop.blueprints.impls.orient.OrientTransactionalGraph.commit(OrientTransactionalGraph.java:49)

Exception_2:
Caused by: com.orientechnologies.orient.core.exception.ODatabaseException: Error on retrieving record using temporary RecordId: #9:-4
    at com.orientechnologies.orient.core.db.raw.ODatabaseRaw.read(ODatabaseRaw.java:256)
    at com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.executeReadRecord(ODatabaseRecordAbstract.java:665)
    at com.orientechnologies.orient.core.tx.OTransactionOptimistic.loadRecord(OTransactionOptimistic.java:183)
    at com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.load(ODatabaseRecordTx.java:200)
    at com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.load(ODatabaseRecordTx.java:36)
    at com.orientechnologies.orient.core.id.ORecordId.getRecord(ORecordId.java:293)
    at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.getVertex(OrientBaseGraph.java:293)
    at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.getVertex(OrientBaseGraph.java:49)

Exception_3:
Caused by: java.lang.NullPointerException
    at com.tinkerpop.blueprints.impls.orient.OrientVertex.removeEdges(OrientVertex.java:582)
    at com.tinkerpop.blueprints.impls.orient.OrientVertex.removeInverseEdge(OrientVertex.java:642)
    at com.tinkerpop.blueprints.impls.orient.OrientVertex.removeEdges(OrientVertex.java:560)
    at com.tinkerpop.blueprints.impls.orient.OrientVertex.remove(OrientVertex.java:156)

    at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.removeVertex(OrientBaseGraph.java:301)
By looking to the line of the exception you're not using latest snapshot where we fixed a similar bug few days ago. Get the last version from the github repository.
 
Thanks,
Manas
 Lvc@
 

Luca Garulli

unread,
May 10, 2013, 8:49:37 AM5/10/13
to orient-database
Hi Manas,
can you post your code that receives that exception?

Lvc@


On 10 May 2013 12:00, Manas <manas...@gmail.com> wrote:
Hi Luca,

As you suggested earlier; for the first NPE issue we did pick the latest code from github (on yesterday i.e. 9 May 2013). For the OConcurrentModificationException; under what scenarios this can arise in a single threaded app? Any pointer in resolving these is highly appreciated.

Thanks much,
Manas


On Wednesday, May 8, 2013 6:08:22 PM UTC+5:30, Manas wrote:
Hi,

I was trying with orientdb-graphed-1.3.0 to construct a graph using the Tinkerpop/Blueprints APIs. However I hit the issue as explained in https://github.com/nuvolabase/orientdb/issues/1167. So I moved to orientdb-graphed-1.4.0-SNAPSHOT. With this now I am not hitting the earlier java.lang.NoSuchMethodError issue but this time hitting a java.lang.NullPointerException:

Caused by: java.lang.NullPointerException
    at com.tinkerpop.blueprints.impls.orient.OrientVertex.deleteEdgeIfAny(OrientVertex.java:617)
    at com.tinkerpop.blueprints.impls.orient.OrientVertex.removeEdges(OrientVertex.java:610)
    at com.tinkerpop.blueprints.impls.orient.OrientVertex.remove(OrientVertex.java:156)

    at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.removeVertex(OrientBaseGraph.java:266)

When I peeked into the OrientVertex.removeEdges implementation; noticed following:

public static void removeEdges(ODocument iVertex, String iFieldName, OIdentifiable iVertexToRemove, boolean iAlsoInverse, boolean useVertexFieldsForEdgeLabels)
  {
    //...some code

    if ((fieldValue instanceof OIdentifiable))
    {
        //...some code
    }
    else if ((fieldValue instanceof OMVRBTreeRIDSet))
    {
      if (iVertexToRemove != null) {
         //...some code
      }
      else
      {
        /*
        NOTE: We are here that means iVertexToRemove is null (OrientVertex.removeEdges is being called from OrientVertex.remove passing null as the value for iVertexToRemove). So passing that null iVertexToRemove into deleteEdgeIfAny below is causing the NLP within deleteEdgeIfAny at the line ODocument doc = (ODocument)iRecord.getRecord().
        */
        for (it = ((OMVRBTreeRIDSet)fieldValue).iterator(false); it.hasNext(); )
          deleteEdgeIfAny(iVertexToRemove);
      }
    }
  }

Could this be fixed and some patch provided? We are evaluating OrientDB for a POC and this issue is blocking us from proceeding further.

Thanks much,
Manas

Manas

unread,
May 15, 2013, 1:43:11 AM5/15/13
to orient-...@googlegroups.com
Hi Luca,

Currently we are hitting these issues with some POC code. We'll try to replicate the issues with minimal test code and share those.

Thanks,

Manas

unread,
May 23, 2013, 8:03:05 AM5/23/13
to orient-...@googlegroups.com
Hi Luca,

Earlier we were using our own transaction boundaries and with that aforementioned exceptions were coming up. However if we do NOT use transactions ourselves then all of our tests are passing. Could you please clarify a few things in that line:

(1) The link http://code.google.com/p/orient/wiki/PerformanceTuning#Wise_use_of_transactions says that for real liner performance we should avoid using transactions. Our use case is such that for a given input java pojo object graph; either all of the nodes make it to the graphDB or none. Is there a way to guarantee this (without using transactions)?

(2) Bulk insert is one of our requirements (at least for the initial extraction/population from our object repository to the graphDB). We were looking at OrientBatchGraph for that purpose. Couple of clarifying questions:
        (2.1) Does OrientBatchGraph use transaction?
        (2.2) If answer to 2.1 is “yes”:
                (2.2.1) How performant would batch update be (since point 1 asks to avoid transaction for better performance).
                (2.2.2) I’d assume that there would be a batch size for each transaction. However would that be able to guarantee the all-or-none requirement as mentioned in point 1? Meaning say batch size is 100 and our object graph has 110 nodes. So if we batch insert, then first 100 nodes would be committed in one transaction and remaining 10 nodes in another transaction. If any exception occurs in the 2nd transaction then only partial object graph (of 100 nodes) would be there in the graphDB.
        (2.3) If answer to 2.1 is “no”:
                (2.3.1) Again we have the same concern as mentioned in point 1 of ensuring all-or-none i.e. the atomic behavior for the input object graph.
        (2.4) Can OrientBatchGraph be used for bulk update of an existing graphDB? Or does it work only when creating the graphDB from scratch as an initial-populate step?
        (2.5) We do have requirements to index some of the vertex/edge properties. How indexing fits with OrientBatchGraph? I mean can we batch update and yet in parallel index the vertex/edge properties?

Appreciate your time in going thru this lengthy list of questions!

Thanks much,

Manas

unread,
May 28, 2013, 3:23:51 AM5/28/13
to orient-...@googlegroups.com
Hi Luca,

We were trying to use OrientBatchGraph and hitting following exception:

java.lang.IllegalArgumentException: Vertex id can not be null
    at com.tinkerpop.blueprints.util.ExceptionFactory.vertexIdCanNotBeNull(ExceptionFactory.java:14)
    at com.tinkerpop.blueprints.impls.orient.OrientBatchGraph.addVertex(OrientBatchGraph.java:27)
    at com.tinkerpop.blueprints.util.wrappers.batch.BatchGraph.addVertex(BatchGraph.java:337)

In the OrientBatchGraph.addVertex call we’re passing null for vertex id (since we don’t have a vertex id!) and assuming that it’d internally create a new Vertex (that's how it use to work with OrientGraph class). However seems we need to pass on non-null vertex id in case of OrientBatchGraph. Can you please explain how to do that?

Best,
Reply all
Reply to author
Forward
0 new messages