Hi

  I have such thread started periodically:


 @Override
    public void run() {

        // get connection from pool
        OObjectDatabaseTx db = OObjectDatabasePool.global().acquire(url, 
dbUser, passwd);
        try {

            // get and store new records
            List<Record> records = db.getLastRecords(1);
            Record[] records = Http.getRecords(lastRecord.size() > 0 ? 
lastRecord.get(0).getId() : null);
            //reverse order
            if (records != null)
                for (int i = records.length - 1; i >= 0; i--)
                    db.save(records[i]);

        } catch (Exception e) {
            throw new RuntimeException(e);

        } finally {
            // return to pool ????
            db.close();
        }
    }



Obviously the connection does not go back to the pool with db.close() 
because after cca 100 runs I get 
com.orientechnologies.common.concur.lock.OLockException: No more resources 
available in pool. Requested resource: remote:localhost...


I red this:
https://groups.google.com/forum/#!searchin/orient-database/SlX2eNBYga8/0HrjD72bhZsJ

So do I have to detach every db object I have loaded/saved or is there 
another way to return the connection properly?
I noticed that GraphDb has shutdown() method but I cant find it in 
OObjectDatabaseTx.

Thank you for any advice







-- 

--- 
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