Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: how to auto commit in oracle?
Afternoon Norman
Thanks for your reply, in my time zone, now is 15:30. :)
The answer you supply done well.
I have used OCI_DEFAULT in OCIStmtExecute , and it looks can autocommit
too. Is it right?
Just now I didn't know how to set autocommit. When I executed some
insert/delete/update statements in sqlplus and didn't execute commit, my OCI
application was blocked by the statement, and if I executed "commit" in
sqlplus, then the application would go on. So I want to know how to set auto
commit in sqlplus to let my application wouldn't be blocked by men. Does
this solve method right?
thanks.
xie.
> Morning Xie,
>
> in SQLPlus :
>
> set autocommit on (turns it on,)
> set autocommit off (turns it off.)
>
> in OCI applications :
>
> OCIStmtExecute(......, OCI_COMMIT_ON_SUCCESS);
>
> The question has to be 'Why ?' though - you only want to commit when a
> complete transaction is finished, not after every SQL statement. Commit
> is quite expensive in resources remember and you should not commit
> unless absolutely necessary.
>
>
> Cheers,
> Norm.
>
> -------------------------------------
> Norman Dunbar
> Database/Unix administrator
> Lynx Financial Systems Ltd.
> mailto:Norman.Dunbar_at_LFS.co.uk
> Tel: 0113 289 6265
> Fax: 0113 289 3146
> URL: http://www.Lynx-FS.com
> -------------------------------------
Received on Wed May 07 2003 - 02:44:28 CDT