does EntityInterceptor apply to secondary datasources defined in datasources.groovy?

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

does EntityInterceptor apply to secondary datasources defined in datasources.groovy?

Ramki
I have an entity interceptor defined in resources.groovy to manipulate SQL (onPrepareStatement()), with below defination intercepting all JDBC calls for the default datasource(DB2), but not intercepting JDBC call to secondary datasource_batch(H2 DB) defined in datasource.groovy for a specific domain objects. Can you please help how to configure interceptor to apply it for all datasources?

    Resources.groovy:
     beans = {
      ...
      entityInterceptor(com.XXX.grendel.util.Db2IsolationLevelInterceptor)
      ...
     }
    dataSource {
        driverClassName = "com.ibm.db2.jcc.DB2Driver"
        url = "jdbc:db2://db2ctdev1:50002/dbag"
        dialect = 'org.hibernate.dialect.DB2Dialect'
        ...
    }
    dataSource_batch {
        driverClassName = "org.h2.Driver"
        username = "sa"
        password = ""
        dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
        url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;INIT=CREATE SCHEMA IF NOT EXISTS GAHPT09D"
        dialect = 'org.hibernate.dialect.H2Dialect'
    }