Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPartitionedDatabasePoolFactory returns a closed pool #4858

Closed
raeesn opened this issue Aug 25, 2015 · 4 comments
Closed

OPartitionedDatabasePoolFactory returns a closed pool #4858

raeesn opened this issue Aug 25, 2015 · 4 comments
Assignees
Labels
Milestone

Comments

@raeesn
Copy link

raeesn commented Aug 25, 2015

Sample code :

           OPartitionedDatabasePoolFactory poolFactory = new OPartitionedDatabasePoolFactory();
    OPartitionedDatabasePool pool = poolFactory.get("plocal:testdb", "administrator", "administrator");
    ODatabaseDocumentTx db = pool.acquire();
    db.close();
    pool.close();

After closing the pool, in the later stage of application; getting the pool from the same factory and trying to acquire a new connection reports "Pool is closed"

   java.lang.IllegalStateException: Pool is closed
at com.orientechnologies.orient.core.db.OPartitionedDatabasePool.checkForClose(OPartitionedDatabasePool.java:373)
at com.orientechnologies.orient.core.db.OPartitionedDatabasePool.acquire(OPartitionedDatabasePool.java:238)

The OPartitionedDatabasePoolFactory retains the pool instance and returns the same, which was closed, as PoolIdentity is same.

@lvca
Copy link
Member

lvca commented Sep 21, 2015

You should close the pool factory at the end of your application.

@lvca lvca closed this as completed Sep 21, 2015
@lvca lvca added the question label Sep 21, 2015
@lvca lvca assigned lvca and unassigned andrii0lomakin Sep 21, 2015
@andrii0lomakin
Copy link
Member

Guys can not agree issue is still relevant.

@andrii0lomakin
Copy link
Member

It is not needed usually to close pool at all, but if users closes it, we should do not use it any more.

@lvca lvca assigned andrii0lomakin and unassigned lvca Sep 23, 2015
andrii0lomakin added a commit that referenced this issue Feb 22, 2016
andrii0lomakin added a commit that referenced this issue Feb 22, 2016
(cherry picked from commit da2a8ba)
@andrii0lomakin
Copy link
Member

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants