0

我正在尝试使用以下代码更新用户类型的顶点。我正在使用 OrientDB Enterprise 2.7

public static Vertex updateVertex(String id,
        Map<String, Object> properties) {
    OrientGraph graph = getGraphFactory().getTx();
    // Add vertex types
    int retry = 0;
    Vertex vertex = null;
    while (retry++ != MAX_RETRY) {
        try {
            vertex = graph.getVertex(id);
            for (String property : properties.keySet()) {
                vertex.setProperty(property, properties.get(property));
            }
            graph.commit();
            return vertex;
        } catch (ONeedRetryException ex) {
            logger.warn("Retry for exception - " + id);
        } catch (Exception e) {
            logger.error("Can not create vertex - ", e);
            e.printStackTrace();
            graph.rollback();
            break;
        }
    }
    return vertex;
}

我在提交步骤中得到以下信息。我不确定代码有什么问题,我之前有过类似的代码。

com.orientechnologies.orient.core.exception.OTransactionException: Error on committing distributed transaction
    DB name="SocialPosts3"
    DB name="SocialPosts3"
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.throwSerializedException(OChannelBinaryAsynchClient.java:428)
    at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.handleStatus(OChannelBinaryAsynchClient.java:379)
    at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:261)
    at com.orientechnologies.orient.client.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:153)
    at com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(OStorageRemote.java:2133)
    at com.orientechnologies.orient.client.remote.OStorageRemote$28.execute(OStorageRemote.java:1316)
    at com.orientechnologies.orient.client.remote.OStorageRemote$28.execute(OStorageRemote.java:1289)
    at com.orientechnologies.orient.client.remote.OStorageRemote$2.execute(OStorageRemote.java:198)
    at com.orientechnologies.orient.client.remote.OStorageRemote.baseNetworkOperation(OStorageRemote.java:230)
    at com.orientechnologies.orient.client.remote.OStorageRemote.networkOperation(OStorageRemote.java:195)
    at com.orientechnologies.orient.client.remote.OStorageRemote.commit(OStorageRemote.java:1289)
    at com.orientechnologies.orient.core.tx.OTransactionOptimistic.doCommit(OTransactionOptimistic.java:560)
    at com.orientechnologies.orient.core.tx.OTransactionOptimistic.commit(OTransactionOptimistic.java:106)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2733)
    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2703)
    at com.tinkerpop.blueprints.impls.orient.OrientTransactionalGraph.commit(OrientTransactionalGraph.java:175)
    at com.readypulse.influencergraphmanager.graphutils.GraphUtil.updateVertex(GraphUtil.java:199)
    at com.readypulse.influencergraphmanager.UserRandomDataPopulator.main(UserRandomDataPopulator.java:48)
Caused by: java.lang.NullPointerException

服务器日志:

2016-08-24 05:08:25:772 WARNI Error deserializing record with id #30:968 send this data for debugging: AAhVc2VyMQAAADoUb3V0X1Bvc3RlZAAAAEUWOwAAAFRBAAAAVT0AAABnNwAAAGo/AAAAcDUAAAB1ABQxOTI5OTU4NDM3AQAAAAEAJQAAAAAAAiQ6QCIzMy4yMTUxTiA5Ny4xNDE3V56EBgpUZXhhcwhNQUxFDERlbnRvbg==  [ORecordSerializerBinary][Batman] Error on distributed transaction commit
java.lang.NullPointerException

2016-08-24 05:08:25:817 WARNI Error deserializing record with id #30:969 send this data for debugging: AAhVc2VyMQAAADoUb3V0X1Bvc3RlZAAAAEQWOwAAAF1BAAAAXj0AAABwNwAAAHM/AAAAeDUAAAB9ABI4NDE1NjQ5MjkBAAAAAgAlAAAAAAACJN8AJQAAAAAAAiT4ICIzOS4xMzk5TiA4NC41MDY0V4LkBwhPaGlvCE1BTEUUQ2luY2lubmF0aQ==  [ORecordSerializerBinary][Batman] Error on distributed transaction commit
java.lang.NullPointerException

2016-08-24 05:08:25:843 WARNI Error deserializing record with id #30:970 send this data for debugging: AAhVc2VyMQAAADoUb3V0X1Bvc3RlZAAAAEQWOwAAAFNBAAAAVD0AAABVNwAAAFg/AAAAYTUAAABmABIxOTQ3MjQ3NDMBAAAAAQAlAAAAAAACJaZKAJK7BRBWaXJnaW5pYQhNQUxFFENoZXNhcGVha2U=  [ORecordSerializerBinary][Batman] Error on distributed transaction commit
java.lang.NullPointerException

2016-08-24 05:08:26:120 WARNI Error deserializing record with id #30:971 send this data for debugging: AAhVc2VyMQAAADoUb3V0X1Bvc3RlZAAAAEQWOwAAAGdBAAAAaD0AAAB7NwAAAH4/AAAAiTUAAACOABIzMjc4Njk0OTEBAAAAAwAlAAAAAAACKPIAJAAAAAAAAieuACQAAAAAAAInrh4kMzguMjU2OE4gMTIyLjAzOTdXkpMJFENhbGlmb3JuaWEITUFMRRJGYWlyZmllbGQ=  [ORecordSerializerBinary][Batman] Error on distributed transaction commit
java.lang.NullPointerException

2016-08-24 05:08:26:161 WARNI Error deserializing record with id #30:972 send this data for debugging: AAhVc2VyMQAAADoUb3V0X1Bvc3RlZAAAAEQWOwAAAOlBAAAA6j0AAAD8NwAAAP8/AAABCDUAAAEPABI0NjA2MzUyNTkBAAAAEAAlAAAAAAACKRUAJAAAAAAAAifQACQAAAAAAAIoAgAlAAAAAAACKVYAJQAAAAAAAilWACUAAAAAAAIpVgAkAAAAAAACKAEAJQAAAAAAAilIACUAAAAAAAIpVgAlAAAAAAACKVYAJQAAAAAAAilGACUAAAAAAAIpVgAlAAAAAAACKVYAJQAAAAAAAilHACUAAAAAAAIpVgAlAAAAAAACKVYQIjM4LjA0MDJOIDg0LjQ1ODRXjPQGEEtlbnR1Y2t5DEZFTUFMRRJMZXhpbmd0b24=  [ORecordSerializerBinary][Batman] Error on distributed transaction commit
java.lang.NullPointerException

2016-08-24 05:08:26:196 WARNI Error deserializing record with id #30:973 send this data for debugging: AAhVc2VyMQAAADoUb3V0X1Bvc3RlZAAAAEQWOwAAAFNBAAAAVD0AAABnNwAAAGo/AAAAczUAAAB4ABIzNzI4Mzk4OTYBAAAAAQAlAAAAAAACKZIIJDM5LjkxODBOIDEwNC45NDU0V/rfCBBDb2xvcmFkbwhNQUxFEFRob3JudG9u  [ORecordSerializerBinary][Batman] Error on distributed transaction commit
java.lang.NullPointerException

2016-08-24 05:08:26:245 WARNI Error deserializing record with id #30:974 send this data for debugging: AAhVc2VyMQAAADoUb3V0X1Bvc3RlZAAAAEUWOwAAAjRBAAACNT0AAAJHNwAAAko/AAACTzUAAAJUABQxODE1MDQ0NTM1AQAAADEAJAAAAAAAAijYACQAAAAAAAIoyAAlAAAAAAACKf8AJAAAAAAAAijJACUAAAAAAAIqAgAkAAAAAAACKM0AJQAAAAAAAioRACQAAAAAAAIozgAlAAAAAAACKhIAJAAAAAAAAijPACQAAAAAAAIo0AAlAAAAAAACKggAJQAAAAAAAioJACQAAAAAAAIo0QAkAAAAAAACKNIAJQAAAAAAAiobACQAAAAAAAIo1AAkAAAAAAACKNMAJQAAAAAAAioZACUAAAAAAAIqHAAkAAAAAAACKNUAJQAAAAAAAioYACUAAAAAAAIqNwAkAAAAAAACKO0AJQAAAAAAAio/ACUAAAAAAAIqHQAlAAAAAAACKiAAJAAAAAAAAijWACUAAAAAAAIqHgAkAAAAAAACKNcAJAAAAAAAAijaACUAAAAAAAIqIQAlAAAAAAACKiIAJAAAAAAAAijcACUAAAAAAAIqJAAkAAAAAAACKN0AJAAAAAAAAijeACQAAAAAAAIo4QAlAAAAAAACKigAJQAAAAAAAiopACUAAAAAAAIqLgAkAAAAAAACKOcAJQAAAAAAAipLACUAAAAAAAIqOAAlAAAAAAACKjEAJAAAAAAAAijwACUAAAAAAAIqNQAlAAAAAAACKksAJQAAAAAAAipLQCIzOS43Nzc0TiA4NC4xOTk2V5rrBghPaGlvCE1BTEUMRGF5dG9u  [ORecordSerializerBinary][Batman] Error on distributed transaction commit
java.lang.NullPointerException
4

0 回答 0