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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to