Discussion:
[arangodb-google] Java Driver wihout a maximum lifetime of request?
Jefferson
2018-04-16 12:56:54 UTC
Permalink
When the network is down, the subsequent request frozen, i need a way to
limit the maximum seconds to get time out of request getting in a specific
Exception, how to do this? Thank you.
--
You received this message because you are subscribed to the Google Groups "ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arangodb+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jefferson
2018-04-16 13:16:18 UTC
Permalink
i put like this:
private static ArangoDB arangoDB = new
ArangoDB.Builder().timeout(1000)........ // 1 second?

i tested turning off the Wifi, and when i click in the button that do this:

try {

BaseDocument myDocument =
Conexao.getCon(loginlogout).db("patricia").collection("usuarios").getDocument("10419",
BaseDocument.class);
System.out.println("Key: " + myDocument.getKey());
lbTeste.setText(myDocument.getKey());
} catch (ArangoDBException e) {
System.err.println("Failed to get document: myKey; " +
e.getMessage());
if (e.getMessage().equals("Was not able to connect to any
host")) {
Conexao.inicializaConexao();
}
}

the UI frozen and stay frozen for long time, and only come back if i turn
on Wifi, i need that the request stop trying after this 1 second timeout,
but look like that is not ocurring
You can configure a timeout when creating your driver instance.
int timeout = 60 * 1000; //milliseconds
ArangoDB arango = new ArangoDB.Builder().timeout(timeout).build();
Post by Jefferson
When the network is down, the subsequent request frozen, i need a way to
limit the maximum seconds to get time out of request getting in a specific
Exception, how to do this? Thank you.
--
You received this message because you are subscribed to the Google Groups "ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arangodb+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jefferson
2018-04-18 07:43:22 UTC
Permalink
In Java Driver when the Internet is off, the timeout dont work and the
request frozen, what could be?
--
You received this message because you are subscribed to the Google Groups "ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arangodb+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jefferson
2018-04-18 08:33:53 UTC
Permalink
With Java Sync Driver, when the internet is off, any operation with Java
Client dont give any feedback...
Post by Jefferson
In Java Driver when the Internet is off, the timeout dont work and the
request frozen, what could be?
--
You received this message because you are subscribed to the Google Groups "ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arangodb+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jefferson
2018-04-18 10:15:41 UTC
Permalink
The problem occur with Async Client too, when i use the Sync, the thread
that run frozen, and when i connect the internet the thread come back, but
when i use Async and the internet is off, nothing happens, no erros, no
response, and i set timeout to 1 second timeout(1000), the version tha im
using is: compile group: 'com.arangodb', name:
'arangodb-java-driver-async', version: '4.3.7'
That is strange. The driver operation should throw an ArangoDBException if
the server is not reachable. Which version of the driver are you using?
Post by Jefferson
With Java Sync Driver, when the internet is off, any operation with Java
Client dont give any feedback...
Post by Jefferson
In Java Driver when the Internet is off, the timeout dont work and the
request frozen, what could be?
--
You received this message because you are subscribed to the Google Groups "ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arangodb+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jefferson
2018-04-18 23:18:21 UTC
Permalink
with: compile group: 'com.arangodb', name: 'arangodb-java-driver-async',
version: '4.3.8-SNAPSHOT' occur this error: > Could not find
com.arangodb:arangodb-java-driver-async:4.3.8-SNAPSHOT
We had a bug in the sync driver which is currently only fixed in the
actual snapshot (see github issue
<https://github.com/arangodb/arangodb-java-driver/issues/186>).
Because of the async driver I have to see your code but I think this could
be the same behavior as in your other question
<https://groups.google.com/forum/#!topic/arangodb/TiHYH1ANoSY>.
Post by Jefferson
The problem occur with Async Client too, when i use the Sync, the thread
that run frozen, and when i connect the internet the thread come back, but
when i use Async and the internet is off, nothing happens, no erros, no
response, and i set timeout to 1 second timeout(1000), the version tha im
'arangodb-java-driver-async', version: '4.3.7'
That is strange. The driver operation should throw an ArangoDBException
if the server is not reachable. Which version of the driver are you using?
Post by Jefferson
With Java Sync Driver, when the internet is off, any operation with
Java Client dont give any feedback...
Post by Jefferson
In Java Driver when the Internet is off, the timeout dont work and the
request frozen, what could be?
--
You received this message because you are subscribed to the Google Groups "ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arangodb+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jefferson
2018-04-19 00:07:29 UTC
Permalink
Sorry, i see now that you said Sync driver, the Async will receive this fix
or don't need?
We had a bug in the sync driver which is currently only fixed in the
actual snapshot (see github issue
<https://github.com/arangodb/arangodb-java-driver/issues/186>).
Because of the async driver I have to see your code but I think this could
be the same behavior as in your other question
<https://groups.google.com/forum/#!topic/arangodb/TiHYH1ANoSY>.
Post by Jefferson
The problem occur with Async Client too, when i use the Sync, the thread
that run frozen, and when i connect the internet the thread come back, but
when i use Async and the internet is off, nothing happens, no erros, no
response, and i set timeout to 1 second timeout(1000), the version tha im
'arangodb-java-driver-async', version: '4.3.7'
That is strange. The driver operation should throw an ArangoDBException
if the server is not reachable. Which version of the driver are you using?
Post by Jefferson
With Java Sync Driver, when the internet is off, any operation with
Java Client dont give any feedback...
Post by Jefferson
In Java Driver when the Internet is off, the timeout dont work and the
request frozen, what could be?
--
You received this message because you are subscribed to the Google Groups "ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arangodb+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jefferson
2018-04-19 02:04:48 UTC
Permalink
I'll use the Sync Driver, but i don't want compile the version 4.3.8
manually, you can push to maven? Thank you.
Post by Jefferson
Sorry, i see now that you said Sync driver, the Async will receive this
fix or don't need?
We had a bug in the sync driver which is currently only fixed in the
actual snapshot (see github issue
<https://github.com/arangodb/arangodb-java-driver/issues/186>).
Because of the async driver I have to see your code but I think this
could be the same behavior as in your other question
<https://groups.google.com/forum/#!topic/arangodb/TiHYH1ANoSY>.
Post by Jefferson
The problem occur with Async Client too, when i use the Sync, the thread
that run frozen, and when i connect the internet the thread come back, but
when i use Async and the internet is off, nothing happens, no erros, no
response, and i set timeout to 1 second timeout(1000), the version tha im
'arangodb-java-driver-async', version: '4.3.7'
That is strange. The driver operation should throw an ArangoDBException
if the server is not reachable. Which version of the driver are you using?
Post by Jefferson
With Java Sync Driver, when the internet is off, any operation with
Java Client dont give any feedback...
Post by Jefferson
In Java Driver when the Internet is off, the timeout dont work and
the request frozen, what could be?
--
You received this message because you are subscribed to the Google Groups "ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arangodb+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...