This kind of error usually occurs when database.close() is not executed. The default value for the maximum number of concurrent connections is 1000, to change it use -Dnetwork.maxConcurrentSessions
Il giorno mercoledì 4 gennaio 2017 15:19:46 UTC+1, leon...@adimplere.com.br ha scritto: > > Hi, > > May anyone use the orientdb with java so that it closes the used connections > and avoids the error "Reached maximum number of concurrent connections" ? > > A simple test that I do. I'm using java8 and orientdb 2.2.14 with remote. > Config sets don't work. > > val poolFactory = new OPartitionedDatabasePoolFactory() > poolFactory.setMaxPoolSize(40) > > val pool = poolFactory.get("remote:db.adimplere.com.br/adimplere", > "admin", "ab12HTT") > val conn = pool.acquire() > > try { > > val query = StringBuilder.newBuilder > > query.append("SELECT @this.tojson(\"fetchPlan:*:-1\") AS itens FROM > Parceiro limit 1000;") > > //connection.query(new OSQLSynchQuery[ODocument]("SELECT * FROM Cliente > WHERE cpfCnpj=?").setFetchPlan("*:-1")) > > val res = conn.query[java.util.List[ODocument]](new > OSQLSynchQuery[ODocument](query.toString)).asScala.toList > > val result = { > if (res.isEmpty) { > None > } else { > Some(res(0).field("itens")) > } > } > > result > > } finally { > conn.close() > pool.close() > poolFactory.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 orient-database+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.