views:

364

answers:

0

I am working on an application using grails to bridge the gap - supporting legacy POJO code, adding things like better session management.

the current implementation relies on 3 database connections 1. hibernate hsql memory based for session management 2. oracle 10g connection to legacy database 3. oracle 10g connection to separate database for new features

I obtained the datasources plugin, followed the advice of a few people http://old.nabble.com/Datasources-plugin-not-working-with-1.1.1-td23542939.html (I didn't comment out the line, I just added hibernate=1.1.1 to plugin.xml)

The plugin works beautifully in read-only mode, but even with cache off, it will create 1 entry and then complain about any future entries

Has anyone been able to successfully get the datasources plugin working, or any recommendations on alternate approaches? I would like to use the gorm if possible, but maybe I should just create a service and use hibernate directly?

Among the errors I've gotten are null-pointer exception org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory_datasource0': Cannot resolve reference to bean 'hibernateProperties_datasource0' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties_datasource0': Invocation of init method failed; nested exception is java.lang.NullPointerException

configuration:

datasources = {
    datasource(name: 'datasource0') {
        domainClasses([app.foo.bar])
        readOnly(false)
        driverClassName('oracle.jdbc.driver.OracleDriver')
        url('jdbc:oracle:thin:@foo:1521:bar')
        username('foo')
        password('bar')
        dialect(org.hibernate.dialect.Oracle10gDialect)
        dbCreate('update')
        logSql(true)
        pool(true)
        hibernate {
            cache {
                use_second_level_cache(false)
                use_query_cache(false)
            }
        }
    }

setting pool to false makes the error go away, but data isn't saved properly and there are still some weird caching issues.