Page 1 of 1
Is TOraStoredProc auto-commit?
Posted: Sun 27 Jun 2010 07:13
by yipych
My code is as below.
Code: Select all
.StoredProcName := 'xxx';
.CreateParam.....
.Execute
The stored proc itself does not include commit. But it seems that it does commit automatically.
The AutoCommit has been set to false on the connection object.
Posted: Wed 30 Jun 2010 13:55
by bork
Hello
I created a simple procedure:
Code: Select all
CREATE OR REPLACE PROCEDURE SCOTT.test_proc
AS
BEGIN
INSERT INTO test_table (id, NAME) SELECT MAX(ID) + 1, 'test ' || TO_CHAR(MAX(ID) + 1) FROM test_table;
END;
/
And executed it:
Code: Select all
OraSession1.AutoCommit := False;
OraStoredProc1.AutoCommit := False;
OraStoredProc1.ExecProc;
A new record wasn't committed to the database. The new record was committed to the database after calling OraSession1.Commit only.
If you have a different result, then please provide me the exact ODAC version that you are using (for example 6.90.0.59). Also please provide the DDL script to create your stored procedure and the tables that are used in your stored procedure.