Skip to content

Commit

Permalink
deploy: 00e9f77
Browse files Browse the repository at this point in the history
  • Loading branch information
lvca committed Dec 8, 2023
1 parent 3cbd4e8 commit 3380a78
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
26 changes: 25 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9924,6 +9924,30 @@ <h4 id="_gremlin_from_java_api" class="discrete">Gremlin from Java API</h4>
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>Since a <code>RemoteDatabase</code> instance cannot be shared between threads, if your application is multi-threads, you can use the <code>ArcadeGraphFactory</code> to acquire <code>ArcadeGraph</code> instances from a pool. Example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-java" data-lang="java">try (ArcadeGraphFactory pool = new ArcadeGraphFactory("127.0.0.1", 2480, "mydb", "root", "playwithdata")) {
try( ArcadeGraph graph = pool.get() ){
// DO SOMETHING WITH ARCADE GRAPH
}
}</code></pre>
</div>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">
Remember to call <code>ArcadeGraph.close()</code> to release the <code>ArcadeGraph</code> instance back into the pool. <code>ArcadeGraph</code> implements <code>Closable</code>, so you can just use it in a <code>try</code> block like in the example above.
</td>
</tr>
</table>
</div>
<h4 id="_gremlin_through_postgres_driver" class="discrete">Gremlin through Postgres Driver</h4>
<div class="paragraph">
<p>You can execute a Gremlin query against ArcadeDB server by using the <a href="#Postgres-Driver">Postgres driver</a> and prefixing the query with <code>{gremlin}</code>.
Expand Down Expand Up @@ -24543,7 +24567,7 @@ <h3 id="ReportAnIssue">11.11. Report an Issue</h3>
<div id="footer">
<div id="footer-text">
Version 23.11.1<br>
Last updated 2023-12-01 22:17:05 UTC
Last updated 2023-12-08 22:20:41 UTC
</div>
</div>
</body>
Expand Down
12 changes: 12 additions & 0 deletions src/main/asciidoc/api/gremlin.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ try( RemoteDatabase database = new RemoteDatabase("127.0.0.1", 2480, "graph", "r
}
```

Since a `RemoteDatabase` instance cannot be shared between threads, if your application is multi-threads, you can use the `ArcadeGraphFactory` to acquire `ArcadeGraph` instances from a pool. Example:

```java
try (ArcadeGraphFactory pool = new ArcadeGraphFactory("127.0.0.1", 2480, "mydb", "root", "playwithdata")) {
try( ArcadeGraph graph = pool.get() ){
// DO SOMETHING WITH ARCADE GRAPH
}
}
```

NOTE: Remember to call `ArcadeGraph.close()` to release the `ArcadeGraph` instance back into the pool. `ArcadeGraph` implements `Closable`, so you can just use it in a `try` block like in the example above.

[discrete]
==== Gremlin through Postgres Driver

Expand Down

0 comments on commit 3380a78

Please sign in to comment.