Hi!
The problem seems to be related to the size of the pool x Number of
threads. I mean, like you cannot have more threads trying to do something
than your pool size.
PS: Im using orientdb-community-1.7-rc2
public static void main(String[] args) throws Exception {
final OrientGraphFactory factory = new
OrientGraphFactory("remote:localhost/tenant2").setupPool(1, 5);
for(int i = 0; i < 100; i++) {
if(i % 10 == 0) {
//Just to not open 100 threads once
Thread.sleep(3000);
}
Thread thread = new Thread(
new Runnable() {
@Override
public void run() {
OrientGraph graph = factory.getTx();
synchronized(this) {
try {
Vertex vertex = graph.addVertex("class:USER");
vertex.setProperty("counter", "teste");
graph.commit();
} finally {
graph.shutdown();
}
}
}
});
thread.start();
}
}
On Wednesday, April 9, 2014 11:55:47 AM UTC-3, Lvc@ wrote:
>
> Hi,
> We've test cases against pool usage, so in order to fix it, we'd ned to
> reproduce your problem.
>
> Lvc@
>
>
>
> On 9 April 2014 16:50, Denis Wilson Souza Rosa
> <[email protected]<javascript:>
> > wrote:
>
>> Hi all!
>>
>> Sometimes I simple got the following exception:
>>
>> com.orientechnologies.common.concur.lock.OLockException: Not more
>> resources available in pool. Requested resource: remote:localhost/xxxx
>> at
>> com.orientechnologies.common.concur.resource.OResourcePool.getResource(OResourcePool.java:46)
>> at
>> com.orientechnologies.orient.core.db.ODatabasePoolAbstract.acquire(ODatabasePoolAbstract.java:93)
>> at
>> com.orientechnologies.orient.core.db.ODatabasePoolAbstract.acquire(ODatabasePoolAbstract.java:78)
>> at
>> com.orientechnologies.orient.core.db.ODatabasePoolBase.acquire(ODatabasePoolBase.java:105)
>> at
>> com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.<init>(OrientBaseGraph.java:121)
>> at
>> com.tinkerpop.blueprints.impls.orient.OrientTransactionalGraph.<init>(OrientTransactionalGraph.java:37)
>> at
>> com.tinkerpop.blueprints.impls.orient.OrientGraph.<init>(OrientGraph.java:54)
>> at
>> com.tinkerpop.blueprints.impls.orient.OrientGraphFactory.getTx(OrientGraphFactory.java:49)
>>
>>
>> I got a pool size of 20 :
>>
>> OrientGraphFactory factory = new
>> OrientGraphFactory("remote:localhost/xxxx").setupPool(1, 20);
>>
>> And I am pretty sure that all my calls are made inside a block like this:
>>
>> OrientGraph graph = factory.getTx();
>> try{
>> ...
>> } finally {
>> graph.shutdown();
>> }
>>
>> I know that increasing the pool size will make this problem not occur so
>> often, but it is a kind of "masking" the real problem. Any ideas of what is
>> the root cause or how can I really solve this issue?
>>
>>
>> Thanks a lot!
>>
>> --
>>
>> ---
>> 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] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
---
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.