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

Pool can't reopen connection #8195

Closed
sreznick opened this issue Apr 5, 2018 · 4 comments
Closed

Pool can't reopen connection #8195

sreznick opened this issue Apr 5, 2018 · 4 comments
Assignees
Labels
Milestone

Comments

@sreznick
Copy link

sreznick commented Apr 5, 2018

OrientDB Version: 3.0.0-RC2

Java Version: 9.0.4

OS: client: win10, orient: dockerized ubuntu

Expected behavior

Open connection after database repair

Actual behavior

exception.ODatabaseException: Cannot execute the request because an asynchronous operation is in progress. Please use a different connection

Steps to reproduce

  1. I have following java program fragment:
       OrientDB db = new OrientDB("remote:localhost", "root", "rootpwd", OrientDBConfig.defaultConfig());
        ODatabasePool pool =  new ODatabasePool(db, "demodb", "root", "rootpwd");


        while (true) {
            ODatabaseSession session = null;
            try {
                Thread.sleep(3000);

                session = pool.acquire();

                OResultSet rs = session.query("SELECT * from SomeClass3");

                System.out.println("session: " + session);
                System.out.println("rs: " + rs);

            } catch (Throwable e) {
                System.out.println("Thrown: "+ e);
                StackTraceElement elems[] = e.getStackTrace();
                for (int i=0; i < Math.min(12, elems.length); i++) {
                    System.out.println(elems[i]);
                }
            } finally {
                if (session != null) session.close();
            }
        }
  1. I start this application and see how it runs in loop outputing "session: ...." and "rs:......".

  2. At some moment I turn off orient db instance.

  3. I see


OIOException: Error on connecting to 127.0.0.1:2424/demodb

but just once. On next iteration I see


ODatabaseException: Cannot execute the request because an asynchronous operation is in progress. Please use a different connection

  1. Moreover when I restore orient db instance these messages continue and database connection is not stored.

It contradicts with my intuition about expected behavior in such case.
I guess reasonable expectations are following:

  1. As soon as orient is restored connection should be re-established.

  2. If connection is dropped then fact of drop should be detected and session on client side should not stay open forever.

  3. Even if session is kept open then new connection should be initiated as part of pool logic. At least until
    pool size is exhausted.

BTW, if I start application when orient is down,and then turn it on again I see that connection is established.

Thanks in advance,
Sergey

@tglman
Copy link
Member

tglman commented Apr 11, 2018

Hi @sreznick,

I just fixed this problem, will be released in 3.0.1.

Regards

@tglman tglman modified the milestones: 3.0.x, 3.0.1 Apr 11, 2018
@gibrit
Copy link

gibrit commented May 22, 2018

i'm getting this error on 2.2.34 too . is there any way to check graph is executing or not?

@tglman
Copy link
Member

tglman commented May 23, 2018

Hi @gibrit,

In 2.2.x we do not have the same issues if you are getting this error is probably because you are executing some database operations in a live query/non blocking/asyn callback.

Regards

@gibrit
Copy link

gibrit commented May 23, 2018

Hi @tglman ,
yes i am runing another query while async call is working .. for example while reading a post , reading its comments on asyncquery . how to do it ? getting new connection for every async query ? . any idea how to do that .

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

6 participants