Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
更改不会反映到OrientDB中的数据库_Orientdb - Fatal编程技术网

更改不会反映到OrientDB中的数据库

更改不会反映到OrientDB中的数据库,orientdb,Orientdb,我正在努力使它工作。这只是一个来自(假定的)文档的普通代码,尽管它工作正常,但数据库中没有任何更改!我看不到名为V1的新类!我使用的是2.0.7和Java1.7 OrientGraphFactory factory = new OrientGraphFactory("plocal:D:/orientdb/databases/GratefulDeadConcerts"); OrientGraphNoTx graph = factory.getNoTx(); try{ OClass V =

我正在努力使它工作。这只是一个来自(假定的)文档的普通代码,尽管它工作正常,但数据库中没有任何更改!我看不到名为V1的新类!我使用的是2.0.7和Java1.7

OrientGraphFactory factory = new OrientGraphFactory("plocal:D:/orientdb/databases/GratefulDeadConcerts");
OrientGraphNoTx graph = factory.getNoTx();
try{
    OClass V = graph.getRawGraph().getMetadata().getSchema().getClass("V");
    OClass V1 = graph.getRawGraph().getMetadata().getSchema().createClass("V1", V);
    V1.createProperty("prop1", OType.STRING);
    V1.createProperty("prop2", OType.STRING);
    ODocument od = new ODocument(V1);
    od.field("prop1", "value1");
    od.field("prop2", "value2");
    od.save();

} catch( Exception e ) {
    System.out.println("ERROR:"+e.getMessage());
    graph.rollback();
}
finally {
    graph.shutdown();
    factory.close();
}

那段代码是有效的。如何验证没有名为V1的类?@vitorenesduarte,因为我在Orientdb Studio中没有看到它