Repeated metadata queries using IDatabaseTester with Oracle

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Repeated metadata queries using IDatabaseTester with Oracle

Daniel BLUM

I have a fairly bare-bones test suite which creates a static IDatabaseTester and gets a static IDatabaseConnection from it for use in all tests; per the FAQ I assumed that using a single connection for all the tests would mean that the fairly expensive metadata queries would only get run once. However, this is not the case: when I turn on Oracle tracing I can see that queries such as this one are run for every test:


SELECT NULL AS table_cat,

       o.owner AS table_schem,

       o.object_name AS table_name,

       o.object_type AS table_type,

       NULL AS remarks

  FROM all_objects o

  WHERE o.owner LIKE :1 ESCAPE '/'

    AND o.object_name LIKE :2 ESCAPE '/'

    AND o.object_type IN ('xxx', 'TABLE')

  ORDER BY table_type, table_schem, table_name


All of these extraneous calls take nearly as long as the test data loading and the actual tests, so I would like to eliminate them. Any clues as to what I might be doing wrong?


The test classes extend junit.framework.TestCase, not a DBUnit class, if that matters.

Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.
dbunit-user mailing list
[hidden email]