Hi Colin.a
I really appreciate your  response. Your advice solved  my problem and 
opened my mind. First I added document to same Db with graph to GraphDb. 
First I tried your advice and I write code it works. After than I realized 
that I don't need ODatabaseDocumentTx for committing documents I just 
try OrientGraph instance and it persists both document and vertice. I 
succeed atomic operation which includes graph operation and document 
operation. You can see at Second Code Fragment.
Thank you again.

------------------------------------First--------------------------------------------------------------------------------------------------------------------------



  OrientGraphFactory factory = new 
OrientGraphFactory("remote:localhost/GratefulDeadConcerts","root","root").setupPool(1,10);
            db = factory.getTx();
            documentDb = db.getRawGraph();

            db.addVertex("class:Person", "name", "Sezer", "age", 33, 
"city", "Rome", "born", "Victoria, TX");

            documentDb.getTransaction().begin();
            ODocument doc = new ODocument("PersonExtended");
            doc.field( "name", "Sezer" );
            doc.field( "sml", 33 );
            doc.save();
            db.commit();

-------------------------------Second-------------------------------------------------------------

 OrientGraphFactory factory = new 
OrientGraphFactory("remote:localhost/GratefulDeadConcerts","root","root").setupPool(1,10);
            db = factory.getTx();
            db.addVertex("class:Person", "name", "Ahmet", "age", 33, 
"city", "Rome", "born", "Victoria, TX");
            ODocument doc = new ODocument("PersonExtended");
            doc.field( "name", "Ahmet" );
            doc.field( "sml", 33 );
            doc.save();
            db.commit();




16 Mart 2015 Pazartesi 23:09:44 UTC+2 tarihinde Colin yazdı:
>
> You can actually get a reference to the underlying ODatabaseDocumentTx 
> from the Graph DB by calling db.getRawGraph().
>
> Try using that instead of creating two separate connections from the same 
> thread.
>
> Let me know how that works.
>
> -Colin
>
> Orient Technologies
>
> The Company behind OrientDB
>
>
>
> On Monday, March 16, 2015 at 1:10:09 PM UTC-5, kurtuluş yılmaz wrote:
>>
>> Hi everbody;
>> Hi; how we can update one document and one graph db in an atomic 
>> operation. Db instances for graph and document databases are different so I 
>> try to use nested transaction but I failed. Is there any way to create 
>> atomic operation it includes update for document and graph databases. 
>> Following code segment just commits graphDb not documentDb. How can commit 
>> graphDb and documentDb in same transaction or in same thread.
>> Best Regards.
>>
>> try{
>>             documentDb = new 
>> ODatabaseDocumentTx("remote:localhost/TestDocumentDb").open("root", 
>> "Kaos8619");
>>
>>             OrientGraphFactory factory = new 
>> OrientGraphFactory("remote:localhost/GratefulDeadConcerts","root","Kaos8619").setupPool(1,10);
>>             db = factory.getTx();
>>             documentDb.getTransaction().begin();
>>             ODocument doc = new ODocument("Person");
>>             doc.field( "name", "Burhan" );
>>             doc.field( "surname", "Skywalker" );
>>             doc.field("age",33);
>>             doc.save();
>>             documentDb.commit();
>>             db.addVertex("class:Person", "name", "Burhan", "age", 33, 
>> "city", "Rome", "born", "Victoria, TX");
>>             db.commit();
>>
>>         }finally {
>>             db.shutdown();
>>             documentDb.close();
>>         }
>>
>>

-- 

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