Some problem about java client i meet today

firstly ,thanks a lot for answering my questions Michel Conrado :handshake:

first question:
io.dgraph.DgraphException: startTs mismatch
as i use java client to add Nquads I meet this problem, it seems a timestamp error But i can not figure out it

second question
io.dgraph.TxnFinishedException: Transaction has already been committed or discarded
at io.dgraph.DgraphClient$Transaction.mutate(DgraphClient.java:240)
at com.onedns.dgraph.InsertTest$1.run(InsertTest.java:233)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
I konw a little about this question , I seems the transaction has been closed when I use it , then I read your source code of java client . there is something not clear :joy: , i can understan when the transaction will invoke a commond , and after the transcantion invoke the commond , it is deperated ? does it mean I must create a new transaction for each query or mutation ? if that , I think it will slow down the speed of my mutation .
I have test my java code , the high speed is only 80 qps , is really so slow so i wonder if i can use dgraph bulk to put new data, but dgraph bulk can check data already exist !
one more thing,which do you think take a lot of time , mutation or query ? do you have a batch query?

third question
after some failure test ,my graph has a lot of wrong data , so I want to have a java api for clear all data, do you have one ? or use the dgraph-ratel ?

last question
while lexing { bladerunner(func: allofterms(ipname, “52.52.146.241”)) { uid ipname } } }: Too many right curl
this problem happens when i try to query on graph-ratel ? what’s the problem ?

can you really understand my poor english ? :laughing:

{ 
bladerunner(func: allofterms(ipname, “52.52.146.241”)) {
 uid
 ipname
 } 
}

I believe you have too many curly brackets.

PS. Beware of stylized Quotation Marks. Use only the Quotation Marks from keyboard.

We only have Ratel - but you can use “drop all” that clears the entire DB.

The other questions I can not answer because I am not a Java developer.

do you have a 'drop all ’ demo , please give the link

curl -X POST localhost:8080/alter -d '{"drop_all": true}'

https://docs.dgraph.io/deploy#delete-database
https://docs.dgraph.io/clients/#alter-the-database-1
https://docs.dgraph.io/clients/#alter-the-database

Maybe, your Nquads data not correct.
I got “Transaction has already been committed or discarded” when my set data or delete data have some problem. If I fix the data I want to set or delete , the Java client works.

ok 好的我去试试:handshake:

1 Like

good luck to you …
:smiley:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.