stored procedures - how to unlock locked tables explicitly in oracle -


i have master stored procedure calls multiple stored procedures write data on multiple tables, around 9-10 in 1 go. , once inserts done, there 1 commit of them.
want use data concurrency , lock tables in individual sub procedures, not have commit,

lock table table_name in lock_mode

will work, hold table until rest of data been inserted in respective tables called after , final commit or rollback called, not idea. don't have dbms_lock opened.

will locking tables in master stored procedures, or locking tables in respective sub-stored procedures option??

my master stored procedure looks

procedure populate_all(p_asofdate date, p_entity varchar2)     begin       populate_abc_book(p_asofdate);       populate_xyz(p_asofdate, p_entity);       populate_def(p_asofdate, p_entity);       populate_aaa(p_asofdate, p_entity);     commit;     exception      when others        rollback;        p_error := sqlerrm;        raise_application_error(-20001,                               '*** unexpected error in populate_all -->' ||                               p_error);    end populate_all; 

where populate_xyz populating xyz table.

it looks don't need locking @ all. inserts without explicit locking.

there no way unlock table in middle of transaction. operation has no sense in oracle; can useful if database supports dirty reads. table lock finishes if

  • commit,
  • rollback or
  • rollback savepoint before lock established

executed.


Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -