Results 1 to 5 of 5

Thread: commit

  1. #1
    Join Date
    May 2012
    Posts
    155

    Unanswered: commit

    Hallo everyone,

    I am about to understand the ON COMMIT PRESERVE ROWS option for a session table. The rows will be kept after a commit. My question:
    COMMIT is meant as a explizite written command line?

    If I dont explizitly write
    Code:
    COMMIT work
    , then it will be no commit implemented internally?

    Example:
    Code:
    SELECT * FROM mySchema.myTable;
    Is there any commit process implemented on the above code?

    Thank you.

    Regards,
    Ratna

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    can you publish more details. how do you invoke the statements.. ?
    command line - tool ?
    what are the clp options ...
    what are you trying todo ? what do you expect ?
    and finally : publishing level and platform would not harm
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    A lot of interfaces have auto-commit (CLP, JDBC, etc). (most default to on). These will automatically issue a commit statement after each statement executed. You need to be aware of this.

    Andy

  4. #4
    Join Date
    May 2012
    Posts
    155
    Hallo przytula_guy and ARWinner,

    thank you Andy for the hints. I am working with db2 9.7, with no manipulation of auto-commit, so I think my configuration for auto-commit is on.

    Now, it will be a little bit complicated with my fantasy regarding commit:
    I learnt in the university, that a DBMS implements a choosen, good transaction protocoll to keep ACID in consistency. For example: strict 2PL.
    This protocoll will "arrange" itself which transaction should be in which time commited and so on.

    My question:
    if I explicitely commit an Unit of Work by typing:
    Code:
    COMMIT work
    Isnt it "dangerous" to commit explicitely, so that the ACID not guaranteed anymore?

    Thank you for the comments.

    Best regards,
    Ratna

  5. #5
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    No, committing explicitly can be a good thing, sometime a necessary thing. Suppose you have business logic that inserts rows into multiple tables. You obviously cannot insert into them all in one statement, so you need several statements to do the work. Now you are going to want to make sure that either all of the work gets done or none of it. So you turn off auto-commit, then do each insert statement. If an error occurs somewhere in the process, then you explicitly rollback. Otherwise when the inserts are complete, you explicitly commit.

    Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •