assertj-db icon indicating copy to clipboard operation
assertj-db copied to clipboard

Unable to detect changes not default schema

Open jitsuishi opened this issue 4 years ago • 1 comments

I am using Oracle DB for testing. Also, the application user and the schema management user are different.

Watching at changes.changesList in the code below, it's null.

OracleDataSource ods = new OracleDataSource();
ods.setURL(...);
ods.setUser(...);
ods.setPassword(...);

Changes changes = new Changes(ods);
changes.setStartPointNow();

makeChangesInTheData();

changes.setEndPointNow();

Changes targets the default schema for change detection, can it target another schema?

jitsuishi avatar Sep 20 '21 05:09 jitsuishi

Hi @jitsuishi Indeed assertj-db know have currently the capability to select schema and the Oracle JDBC driver either. I think you can use Hikari as workaround.

You can try this :

HikariDataSource hikariDs = new HikariDataSource(); hikariDs.setDataSource(ods); hikariDs.setConnectionInitSql("ALTER SESSION SET CURRENT_SCHEMA = SOME_SCHEMA");

Julien.

VanRoy avatar Sep 25 '21 12:09 VanRoy