using setAutoCommit(false) in DB2 and MSSQL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • giffy
    New Member
    • Aug 2008
    • 9

    using setAutoCommit(false) in DB2 and MSSQL

    I need to use commit and rollback feature in DB2. With executeBatch() feature.

    I am facing the problems

    a) journalling features are contradicting with it
    what does that mean? And how to get rid of that.

    b) I am not sure what is the databse version. How to see the version of database and the compatibility as far as executeBatch() support is concerned

    c) Do we need it mandatorily to use autoCommit= false for using executeBatch()

    Again I also need to use executeBatch() in MSSQL. but to do so when I am trying to use setAutoCommit(f alse) I am getting error related to cursor lock.

    Hve someone through such problems? Any help is appreciated.
  • sakumar9
    Recognized Expert New Member
    • Jan 2008
    • 127

    #2
    It would be helpful if you can provide some additional information like what is the problem that you are facing.

    1. Use 'db2level' command to get the database version.
    2. You can also refer to some of the samples that are shipped with DB2. You can find them at SQLLIB/samples directory.

    (I am sure I didn't answered ur question....... .. :( )
    Regards
    -- Sanjay

    Comment

    • giffy
      New Member
      • Aug 2008
      • 9

      #3
      Thanks Sanjay. And sorry for delayed addendum

      for DB2 case when I am doing

      Code:
      setAutoCommit(false);
      nothing changes. And things seem to be working the same way as with the default setting of autoCommit mode on transaction level.

      When i tried to find the reason it was suggested that to get that working. You need to put the journaling on on DB2 file on which you want this feature to work.

      And setting on and off the journals is a cumbersome process for this file with more than 60K records.

      ==============

      Again related to autoCommit change in MSSQL. Once I do that I am not able to open another resultSet even for select once I do
      setAutoCommit(f alse);

      . When trying to do so I am getting an error related to cursor. I dun have the exact message. But it was suggested to use

      Code:
      selectMethod=cursor instead of default "Direct"
      So I added the parameter ;SelectMethod=C ursor to JDBC URL

      but to no avail.

      =======
      hope I have provided more information.

      Comment

      Working...