You are not logged in.
Pages: 1
Hi AB,
I try to use, TSQLDBOracleConnectionProperties.Create('ORCL81','orcl81','scott','tiger');
I got error, "raise ESQLDBOracle.CreateFmt('Invalid oci.dll: missing %s',[OCI_ENTRIES[]]);"
I use oracle 8.1.7, is it compatible with mormot 1.18 ?
Thank you.
Offline
procedure TForm1.Button1Click(Sender: TObject);
var
Props : TSQLDBOracleConnectionProperties;
rows : ISQLDBRows;
begin
Props := TSQLDBOracleConnectionProperties.Create('localhost','XE','scott','tiger');
try
rows := Props.Execute('select * from truck_trans',[]);
rows.Step;
Showmessage(utf8ToString(rows.ColumnUTF8(0)));
finally
//Props.Free;
end;
end;
It is running well for oracle XE 11g, OS windows 7 64bit (apps compiled inside 32bit windows XP).
Props.Free will raise exception "access violation, ntdll.dll"
Last edited by Cahaya (2015-06-22 16:18:26)
Offline
1. Oracle 8 is not compatible, I guess.
It is a pretty old version.
2. The rows: ISQLDBRows is freed after Props by the compiler.
Please use a common property, or a sub-function, as stated by http://synopse.info/files/html/Synopse% … l#TITL_137
Or release rows by hand:
procedure TForm1.Button1Click(Sender: TObject);
var
Props : TSQLDBOracleConnectionProperties;
rows : ISQLDBRows;
begin
Props := TSQLDBOracleConnectionProperties.Create('localhost','XE','scott','tiger');
try
rows := Props.Execute('select * from truck_trans',[]);
rows.Step;
Showmessage(utf8ToString(rows.ColumnUTF8(0)));
finally
rows := nil; // should be freed BEFORE Props
Props.Free;
end;
end;
Offline
Hi AB,
Your last code still error.
Something wrong with this, OCI.Check(nil,self,OCI.StmtRelease(fStatement,fError,nil,0,RELEASE_MODE[AfterError]),fError) else
OCI.HandleFree(fStatement,OCI_HTYPE_STMT);
Delphi 7 debug come to that line when Props.Free execute.
Thank you.
Offline
This code is good without error. I guess something wrong with OCI.Check line.
By the way, any problem with my oracle XE 32 bit inside 64 bit windows ? In my view, my oracle database is good, but I don't know whether any connection inside your code, related to memory.
if fStatement<>nil then begin
{
if fUseServerSideStatementCache then
OCI.Check(nil,self,OCI.StmtRelease(fStatement,fError,nil,0,RELEASE_MODE[AfterError]),fError) else
OCI.HandleFree(fStatement,OCI_HTYPE_STMT);
}
OCI.HandleFree(fStatement,OCI_HTYPE_STMT);
fStatement := nil;
end;
Offline
Your procedure TSQLDBOracleStatement.FreeHandles(AfterError: boolean) probably has problem. Because I got an error when I execute Free. The error probably because your code :
if fUseServerSideStatementCache then
OCI.Check(nil,self,OCI.StmtRelease(fStatement,fError,nil,0,RELEASE_MODE[AfterError]),fError) else
OCI.HandleFree(fStatement,OCI_HTYPE_STMT);
I don't understand your last posted. What sub function you mean ?
Last edited by Cahaya (2015-06-23 15:54:01)
Offline
AB,
I got the same error when I free TSQLDBOracleConnectionProperties from lazarus 1.2.6.
I think you don't get my problem. Did you test it for oracle xe ?
Thank you.
Offline
Did you test it, for delphi 7 ? The same problem arise when you free TSQLDBOracleConnectionProperties;
The problem is OCI.StmtRelease. Any solution ?
Thank you.
Offline
I do not understand the context of the problem.
Did you correct your previous code about Props: TSQLDBOracleConnectionProperties and rows: ISQLDBRows ?
What you posted above was wrong: the ISQLDBRows should be released before the TSQLDBOracleConnectionProperties, otherwise the statement is released on a closed connection.
Offline
I did, this before as you suggested,
procedure TForm1.Button1Click(Sender: TObject);
var
Props : TSQLDBOracleConnectionProperties;
rows : ISQLDBRows;
begin
Props := TSQLDBOracleConnectionProperties.Create('localhost','XE','scott','tiger');
try
rows := Props.Execute('select * from truck_trans',[]);
rows.Step;
Showmessage(utf8ToString(rows.ColumnUTF8(0)));
finally
rows := nil; // should be freed BEFORE Props
Props.Free;
end;
end;
I still got an error for delphi 7 but it work for lazarus 1.2.6
By the way, I can not hack my delphi 7 for system and sysutils. Is it enough if I just replace the dcu ?
Thank you.
Offline
Your code is just wrong.
Please try what I stated:
procedure TForm1.Button1Click(Sender: TObject);
procedure DoQuery(Props: TSQLDBOracleConnectionProperties);
var rows : ISQLDBRows;
begin
rows := Props.Execute('select * from truck_trans',[]);
rows.Step;
Showmessage(utf8ToString(rows.ColumnUTF8(0)));
end;
var
Props : TSQLDBOracleConnectionProperties;
begin
Props := TSQLDBOracleConnectionProperties.Create('localhost','XE','scott','tiger');
try
DoQuery(Props);
finally
Props.Free;
end;
end;
FPC do release the interface variable ASAP, whereas Delphi does it at the end of the method.
Please see http://synopse.info/forum/viewtopic.php?pid=9174#p9174
Offline
AB,
procedure TForm1.Button3Click(Sender: TObject);
var
rows : ISQLDBRows;
vStr : string;
vStart,vEnd: dword;
begin
try
vStart := GetTickCount;
rows := DB.Execute('select * from truck_trans;',[]);
vStr := Utf8ToString(rows.FetchAllAsJSON(true));
vEnd := GetTickCount - vStart;
ShowMessage(IntToStr(vEnd));
finally
rows._Release;
rows := nil;
DB.Free;
end;
end;
I work well after release ISQLDBRows and set it to nil;
By the way, I use the same code and measure performance executable between delphi 7 and lazarus 1.2.6, and I found lazarus code is faster around 4x. I use gettickcount to measure the timing.
Offline
How to use your optimize RTL for delphi 7 ? I failed to run SynopseRTL042004.exe
Can I just replace my dcu with SynopseRTLdcu.zip ?
Thank you again.
Offline
Thank you AB,
By the way I tried to test your SynDBOracle compare to Zeos, the result zeos for many times is faster around 5%.
Your blog said http://blog.synopse.info/post/2011/07/0 … cle-access, Syndboracle 10x faster.
I used delphi 7 to test it. All inside the same coding for 33.402 rows.
FetchallAsJson also slow compare to todataset.
Offline
The TDataSet does not retrieve the data, until it is needed, whereas FetchAllAsJson returns all data.
Try to fetch all data from TDataSet, and I guess you would find out.
Compare using SynDBExplorer, and you would make yourself a better idea.
Zeos has been recently optimized, so is very fast.
But SynDBOracle is faster for insertion, by the ORM, using array binding, for instance, I guess.
Offline
AB,
Both between SynDB and Zeos get all data for TDataset. But of course SynDBOracle has a very nice feature, need one oci.dll only. I just guessing, both is very efficient.
Your framework is great. I'm still exploring before decide to moving my hospital apps.
Offline
AB,
After using your RTL properly, I got an amazing speed. FetchAllAsJson boost 3x faster. Impressing.
And now, SynDbOracle is faster than Zeos, for select stmt, around 14% faster.
Amazing !
Offline
I got those speed after declare FastMM4 unit. Delphi SynDBOracle vs Lazarus SynDbOracle.
Delphi is faster now.
Great job.
By the way I'm looking an article on how ORM link to vcl. With my slow brain, I did not find any real example from your lengthy pdf.
Thank you anyway.
Offline
Pages: 1