Search code examples
grailsjdbcdb2ibm-midrangejournaling

Can I make a Grails web app using db2 jdbc driver not commit?


My situation: I work with a lot of RPG programmers who have created files on the IBM-i in a way that does not create a journal. I've created a Grails app which uses a db2 jdbc driver to connect to a file and update, insert, etc. I'm getting an error:

com.ibm.db2.jdbc.app.DB2DBException: MYFILE in MYLIB not valid for operation.
  Cause . . . . . :   The reason code is 3 .  Reason codes are:
  ...blah blah blah...
  3 -- MYFILE not journaled, no authority to the journal, or the journal state is *STANDBY.  Files with an RI constraint action of CASCADE, SET NULL, or SET DEFAULT must be journaled to the same journal. 
  ...blah blah blah...

I know that I could start journaling the file with STRJRNPF, but I'd rather not keep up with it (no scolding please). Is there a parameter for the db2 jdbc connection url that I can set to let it know not to try to commit?

Here's my current connection info:

dataSource
{
  dbCreate = "update" // one of 'create', 'create-drop', 'update', 'validate', ''
  pooled = true
  url = "jdbc:db2:*local;naming=system;libraries=LIBS;errors=full"
  driverClassName = "com.ibm.db2.jdbc.app.DB2Driver"
  username = "user"
  password = "pass"
  dialect = org.hibernate.dialect.DB2400Dialect.class
}

EDIT: Here is what I've tried:

url = "jdbc:db2:*local;naming=system;libraries=LIBS;errors=full;transaction isolation=none"

Solution

  • Finally, this did end up having to do with Grails/Hibernate. Here is what the datasource ended up looking like:

    dataSource
    {
      dbCreate = "update" // one of 'create', 'create-drop', 'update', 'validate', ''
      pooled = true
      url = "jdbc:db2:*local;naming=system;libraries=LIBS;errors=full;transaction isolation=none"
      driverClassName = "com.ibm.db2.jdbc.app.DB2Driver"
      username = "user"
      password = "pass"
      dialect = org.hibernate.dialect.DB2400Dialect.class
      properties{                      
        defaultTransactionIsolation = 0
      }
    }
    

    Thanks to @Buck Calabro 's comments and this question.