DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: dba_jobs / auto-commit?

  1. #1
    Join Date
    Apr 2002
    Location
    Germany.Laudenbach
    Posts
    448
    ORacle 8.1.7.3.5 OS/390


    Hello;
    is it possible that PL/SQL-Jobs, queud with dba_jobs, which have no commit could be autocommited?
    We have a job detected running every minute, without commit, but with changes in databse.

    Orca

  2. #2
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Originally posted by Orca777
    is it possible that PL/SQL-Jobs, queud with dba_jobs, which have no commit could be autocommited?
    No.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  3. #3
    Join Date
    Jul 2000
    Posts
    521
    I guess when a session terminates, COMMIT happens by default unless things are explicitly rolled back.
    svk

  4. #4
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Originally posted by svk
    I guess when a session terminates, COMMIT happens by default unless things are explicitly rolled back.
    You guessed wrong!

    When session teerminates ROLLBACK happens to any changes that were not commited previously.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  5. #5
    Join Date
    Jul 2000
    Posts
    521
    Orca777,

    Can you post some more info @ the job itself ?
    What is it suppose to do ? Is it a stored proc or just a pl/sql script ?
    svk

  6. #6
    Join Date
    Jul 2000
    Posts
    521
    A simple test :

    create table t1 (d date);
    truncate table t1;
    create or replace procedure ins_t1 as
    begin
    insert into t1 values (sysdate);
    end;
    /
    show error
    variable x number;
    execute DBMS_JOB.SUBMIT(:x,'ins_t1;',SYSDATE,'SYSDATE + 1/(24*60)');

    So, the job is defined to run every minute. No COMMIT mentioned anywhere.

    Now, check the contents of table t1 after every minute and you will see a row there every minute.....
    svk

  7. #7
    Join Date
    Feb 2000
    Location
    Singapore
    Posts
    1,758
    The transactions will be commited if the session is closed with a exit command and will be rolledback if the session terminates abnormally.

    Sanjay

  8. #8
    Join Date
    Oct 2001
    Location
    Hyderabad
    Posts
    44
    hi ,
    I am trying to do the same job shedule in my system.The table T1 is created and Procedure also created, but no rows are inserted into Table T1.Why?

  9. #9
    Join Date
    Feb 2002
    Location
    Dallas , Texas
    Posts
    158
    Hi,

    It will not insert because you have to write commit in the procedure.

    Take Care.

  10. #10
    Join Date
    Feb 2000
    Location
    Singapore
    Posts
    1,758
    It works without commit also.
    May be your job is not running try forcing the job to run and check the results.

    Sanjay

Posting Permissions

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


Click Here to Expand Forum to Full Width