Menu

#44 not a proxy instance if WorkingTableScope.LOCAL_DATABASE and Tomcat jdbc pool

v1.0_(example)
pending-fixed
None
5
2020-08-05
2020-08-03
No

Hello there.

I am trying to make an export work in embedded mode like so:
(tried both 9.5.0 and 9.4.3)

Subsetter subsetter =
        new Subsetter(
            dataSource,
            DBMS.ORACLE,
            datamodelFoler.getURL(),
            extractionModel.getURL(),
            ScriptFormat.SQL);
    subsetter.getExecutionContext().setScope(WorkingTableScope.LOCAL_DATABASE);
    subsetter.getExecutionContext().setTargetDBMS(DBMS.ORACLE);
    subsetter.getExecutionContext().setLimit(10_000L);

    subsetter.execute(where, exportScriptFile);

We do use Tomcat Jdbc Pool in our application. Under this circumstances the execution is failing with a following stacktrace:

19:13:35.163 [http-nio-8211-exec-2] ERROR a.o.t.b.o.w.e.ApplicationExceptionMapper - Internal exception
java.lang.IllegalArgumentException: not a proxy instance
    at java.base/java.lang.reflect.Proxy.getInvocationHandler(Proxy.java:1103)
    at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:98)
    at com.sun.proxy.$Proxy471.equals(Unknown Source)
    at java.base/java.util.ArrayList.remove(ArrayList.java:655)
    at net.sf.jailer.util.CancellationHandler.end(CancellationHandler.java:135)
    at net.sf.jailer.database.Session.executeQuery(Session.java:577)
    at net.sf.jailer.database.Session.executeQuery(Session.java:602)
    at net.sf.jailer.database.Session.executeQuery(Session.java:470)
    at net.sf.jailer.database.Session.executeQuery(Session.java:446)
    at net.sf.jailer.entitygraph.local.LocalEntityGraph$4.process(LocalEntityGraph.java:525)
    at net.sf.jailer.database.InlineViewBuilder.close(InlineViewBuilder.java:126)
    at net.sf.jailer.entitygraph.local.LocalEntityGraph$RemoteInlineViewBuilder.close(LocalEntityGraph.java:123)
    at net.sf.jailer.database.Session.executeQuery(Session.java:568)
    at net.sf.jailer.database.Session.executeQuery(Session.java:602)
    at net.sf.jailer.database.Session.executeQuery(Session.java:470)
    at net.sf.jailer.database.Session.executeQuery(Session.java:456)
    at net.sf.jailer.entitygraph.local.LocalEntityGraph.resolveAssociation(LocalEntityGraph.java:517)
    at net.sf.jailer.subsetting.SubsettingEngine$2.run(SubsettingEngine.java:410)
    at net.sf.jailer.subsetting.SubsettingEngine$3.run(SubsettingEngine.java:443)
    at net.sf.jailer.util.JobManager.executeJobs(JobManager.java:147)
    at net.sf.jailer.subsetting.SubsettingEngine.resolveAssociations(SubsettingEngine.java:448)
    at net.sf.jailer.subsetting.SubsettingEngine.export(SubsettingEngine.java:218)
    at net.sf.jailer.subsetting.SubsettingEngine.export(SubsettingEngine.java:1483)
    at net.sf.jailer.api.Subsetter.execute(Subsetter.java:162)
    at net.sf.jailer.api.Subsetter.execute(Subsetter.java:126)

As soon as I root jailer to database without connection pool it work.
It works also with the tomcat pool if I set the execution scope to GLOBAL (unfortunatelly not an option for our case)

Configuration of Tomcat Pool:

PoolProperties poolProperties = new PoolProperties();
    poolProperties.setUrl(driverUrl);
    poolProperties.setDriverClassName(ORACLE_DRIVER);
    poolProperties.setTestOnBorrow(true);
    poolProperties.setTestOnConnect(true);
    poolProperties.setTestWhileIdle(true);
    poolProperties.setTestOnReturn(true);
    poolProperties.setInitialSize(oracleConnectionProperties.getPool().getInitialSize());
    poolProperties.setMaxActive(oracleConnectionProperties.getPool().getMaxActive());
    poolProperties.setMinIdle(oracleConnectionProperties.getPool().getMinIdle());
    poolProperties.setMaxIdle(oracleConnectionProperties.getPool().getMaxIdle());
    poolProperties.setTimeBetweenEvictionRunsMillis(
        oracleConnectionProperties.getPool().getTimeBetweenEviction());
    poolProperties.setMinEvictableIdleTimeMillis(
        oracleConnectionProperties.getPool().getMinEvictableIdle());
    poolProperties.setValidationQuery("select 1 from dual");
    String connectionPropDefaultLobPrefetchSize = connectionPropDefaultLobPrefetchSize();
    poolProperties.setConnectionProperties(connProps + connectionPropDefaultLobPrefetchSize);
    poolProperties.setInitSQL(INIT_SQL);
    poolProperties.setLogValidationErrors(true);
    poolProperties.setRemoveAbandoned(true);
    poolProperties.setRemoveAbandonedTimeout(REMOVE_ABANDONED_TIMEOUT);
    poolProperties.setLogAbandoned(true);

Thank you for your efforts.
Happy to help in case of any questions

Discussion

  • Ralf Wisser

    Ralf Wisser - 2020-08-03

    Hi,

    Thanks for the report, this is indeed a bug.
    Based on release 9.5.0 I have attached a patch here.
    Could you please test this? I don't have a Tomcat Jdbc pool available right now.
    Please replace the file "jailer.jar" (or jailer-engine-9.5.0.6.jar, is you use that) with the attached one.

    HTH,
    Ralf

     
    • Ralf Wisser

      Ralf Wisser - 2020-08-03

      Sorry, the patch from before was faulty. Here's the correction.

       
  • Oleh Novikov

    Oleh Novikov - 2020-08-03

    This has helped. I have just dropped the jar into my local maven repository and replaced the 9.5.jar
    Thank you for an instant reaction. Hope it gets published any time soon

    Cheers

     
  • Ralf Wisser

    Ralf Wisser - 2020-08-05
    • status: open --> pending-fixed
     
  • Ralf Wisser

    Ralf Wisser - 2020-08-05

    fixed in release 9.5.1

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB