Several problems with NonBlocking-mode
Posted: Wed 05 Apr 2006 13:20
Delphi 7
ODAC 5.70.0.29
Oracle 9.2.0.7
We have some problems when using NonBlocking-mode. We tried to expose the problems with the following method (see also comments in the code):
- after calling "BreakExec", "SQL.Executing" is still true, but in our opinion it should be false, right?
- access violation when freeing the session (see code below)
- after BreakExec the "drop table" doesn't work (it does nothing). See comment "//this doesn't drop table" in code below
- after calling "BreakExec" we call Commit and get the number of rows, which is always 0: is this correct? Shouldn't BreakExec just abort the process and if we call commit afterwards, all changes until the BreakExec should be stored? (see comment "//the following line returns always 0" in the code below)
- if we use "lSession.Options.Net := False" then we get a "ORA-24381: Error in Array-DML" exception in the line "Assert(SQL.Executing, 'executing');"
Can you please give me some hints about the described problems? Thanks.[/code]
ODAC 5.70.0.29
Oracle 9.2.0.7
We have some problems when using NonBlocking-mode. We tried to expose the problems with the following method (see also comments in the code):
- after calling "BreakExec", "SQL.Executing" is still true, but in our opinion it should be false, right?
- access violation when freeing the session (see code below)
- after BreakExec the "drop table" doesn't work (it does nothing). See comment "//this doesn't drop table" in code below
- after calling "BreakExec" we call Commit and get the number of rows, which is always 0: is this correct? Shouldn't BreakExec just abort the process and if we call commit afterwards, all changes until the BreakExec should be stored? (see comment "//the following line returns always 0" in the code below)
- if we use "lSession.Options.Net := False" then we get a "ORA-24381: Error in Array-DML" exception in the line "Assert(SQL.Executing, 'executing');"
Code: Select all
procedure TOraSession_t.TestNonBlocking;
const
CRecords = 1000000;
var
lSession: TOraSession;
begin
lSession := TOraSession.Create(nil);
try
lSession.Options.Net := False;
lSession.Username := //user name;
lSession.Password := //password;
lSession.Server := //enter server address here;
lSession.LoginPrompt := False;
lSession.Connect;
Assert(lSession.Connected, 'connected');
try lSession.ExecSQL('drop table test_nb', []);
except on EOraError do;
end;
lSession.ExecSQL('create table test_nb (i integer)', []);
try
lSession.ThreadSafety := True;
lSession.SQL.NonBlocking := True;
with lSession do begin
SQL.Text := 'insert into test_nb (i) values (1)';
SQL.Execute(CRecords);
Assert(SQL.Executing, 'executing');
Sleep(500);
SQL.BreakExec;
//SQL.Executing is true here, but should be false
Assert(not SQL.Executing, 'executing after breakexec');
//here committing < CRecords.
lSession.Commit;
lSession.SQL.NonBlocking := False;
lSession.ThreadSafety := False;
//the following line returns always 0
lSession.ExecSQL('begin select into :C count(*) from test_nb; end;',
[0]);
OutputDebugString('count = ' +
lSession.ParamByName('C').AsString);
end;
finally
lSession.SQL.NonBlocking := False;
lSession.ThreadSafety := False;
//this doesn't drop table
lSession.ExecSQL('drop table test_nb', []);
end;
finally
FreeAndNil(lSession); //Access violation
end;
end;