How to get callback in asynchronous

Hi,
Version

       <dependency>
            <groupId>com.orientechnologies</groupId>
            <artifactId>orientdb-jdbc</artifactId>
            <version>3.0.29</version>
        </dependency>

BackGround

I am using Community Edition, and I set executionMode to “asynchronous”. and i want to get the callback

First Usage

 try (ODatabaseSession session = pool.acquire()) {
      session.command(new OCommandSQL("sql").onAsyncReplicationError(new OAsyncReplicationError() {
           @Override
           public ACTION onAsyncReplicationError(Throwable iException, int iRetry) {
                 return null;
           }
      })).execute();
 }

Result

when i did as above. i find the method called command has the annotation called @Deprecated. and i should use it like this:

try (ODatabaseSession session = pool.acquire()) {
       session.command("sql");
 }

but how can i get the callback in this way.

At the same time, I find the usage is ok in the jar called orientdb-graphd, like this:

Second Usage

      OrientGraphFactory factory = new OrientGraphFactory(url);
      OrientGraphNoTx graph = factory.getNoTx();

      graph.command(new OCommandSQL("sql").onAsyncReplicationError(new OAsyncReplicationError() {
           @Override
             public ACTION onAsyncReplicationError(Throwable iException, int iRetry) {
                 return null;
             }
      })).execute();

Question

I find there are some dependencies about tinkerpop in the jar called orientdb-graphdb.

What shoud i do to get the callback with the First Usege.

Thanks

52HZ