File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
src/test/java/com/arangodb/internal/velocystream Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,40 @@ public void run() {
8989 assertThat (iterator .next (), is (SLOW ));
9090 }
9191
92+ @ Test
93+ public void multiThreadSameDatabases () throws Exception {
94+ final ArangoDB arangoDB = new ArangoDB .Builder ().build ();
95+
96+ final ArangoDatabase db = arangoDB .db ();
97+
98+ final Collection <String > result = new ConcurrentLinkedQueue <String >();
99+ final Thread t1 = new Thread () {
100+ @ Override
101+ public void run () {
102+ try {
103+ db .query ("return sleep(1)" , null , null , null );
104+ result .add ("1" );
105+ } catch (final ArangoDBException e ) {
106+ }
107+ }
108+ };
109+ final Thread t2 = new Thread () {
110+ @ Override
111+ public void run () {
112+ try {
113+ db .query ("return sleep(1)" , null , null , null );
114+ result .add ("1" );
115+ } catch (final ArangoDBException e ) {
116+ }
117+ }
118+ };
119+ t2 .start ();
120+ t1 .start ();
121+ t2 .join ();
122+ t1 .join ();
123+ assertThat (result .size (), is (2 ));
124+ }
125+
92126 @ Test
93127 public void multiThreadMultiDatabases () throws Exception {
94128 final ArangoDB arangoDB = new ArangoDB .Builder ().build ();
You can’t perform that action at this time.
0 commit comments