Mega Search
23.2 Million


Sign Up

Make a donation  
dbexpress compatible with Oracle 12c?  
News Group: embarcadero.public.delphi.database.dbexpress

Using Delphi XE2, as far as I can tell dbExpress is compatible with Oracle 12c and the Oracle 12c Fat client.  However I found one possible issue with a simple demo Datasnap server.  Each multi-threaded database connection is leaking handles and memory.  I can reproduce this on two VMs with the 12.1.0.1 fat client.  If I make all the connections on the main thread, TThread.Synchronize the "sqlconnection.connected = True", then the leak is no longer present.   Each connection leaks 9 un-named mutex handles
 and a variable amount (~40k per connection) of windows heap (outside of FastMM allocations).  I cannot reproduce this with the Oracle 11c fat client against Oracle 11g.

I ported that datasnap demo to XE6 and FireDac and it exhibits the exact same behavior.  

The Oracle OCI group tells me I need to re install, "we don't see it", and submit a ticket.  Apparently there are no settings I can change in the fat client.  So are we sure that these database layers are fully compatible with 12c?  The docs just say Oracle 8 and higher.   I'm lost which direction to isolate this problem.   Is it a Delphi issue, Configuration of either side, or an Oracle issue.

I know this is an odd one and maybe I'm missing something obvious.  So thanks in advance for any help or ideas or criticism of any kind.

Jeff Chojnacki

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 11-Dec-2014, at 10:18 AM EST
From: Jeff Chojnacki
 
Re: dbexpress compatible with Oracle 12c? [Edit]  
News Group: embarcadero.public.delphi.database.dbexpress
I spent the weekend and created a test program in Java and I can reproduce the same handle leak with it.  There is still more to figure out but, thankfully it's not a Delphi related issue.

> {quote:title=quinn wildman wrote:}{quote}
> A few suggestions here:

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 15-Dec-2014, at 11:33 AM EST
From: Jeff Chojnacki
 
Re: dbexpress compatible with Oracle 12c? [Edit]  
News Group: embarcadero.public.delphi.database.dbexpress
Note that this is not a forum to report bugs. The Quality Portal at 
http://quality.embarcadero.com is your best venue. You can also use 
Quality Central if you wish.

A few suggestions here:
* If you are using an unsupported version of Oracle (IOW our DBExpress 
driver with Oracle 12), it will not be fixed.
* Be sure to test with our DBExpress driver. If the problem is only 
occurs with the Devart DBExpress driver, then it would be a test case error.

Jeff Chojnacki wrote:
> I created a simple test case with Delphi XE6 to show the problem.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 15-Dec-2014, at 9:14 AM EST
From: quinn wildman
 
Re: dbexpress compatible with Oracle 12c?  
News Group: embarcadero.public.delphi.database.dbexpress
Because you are using a driver from Devart, you need to contact Devart. 
Any memory leak in this scenario not be coming from our code.

Jeff Chojnacki wrote:
>   I tested again using the DevArt dbExpress driver for Oracle version 6.4.7 with Delphi XE6.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 15-Dec-2014, at 9:09 AM EST
From: quinn wildman
 
Re: dbexpress compatible with Oracle 12c? [Edit]  
News Group: embarcadero.public.delphi.database.dbexpress
I created a simple test case with Delphi XE6 to show the problem.   This can be converted to use the Delphi dbExpress driver or FireDAC. 
{code}
unit ufrmMain;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB, Data.SqlExpr, Vcl.StdCtrls, DBXDevartOracle,
  Data.DBXOracle;

type
  TForm1 = class(TForm)
    btnThreaded: TButton;
    btnMainThread: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    eDatabase: TEdit;
    eUserName: TEdit;
    ePassword: TEdit;
    procedure btnThreadedClick(Sender: TObject);
    procedure btnMainThreadClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure ConnectionTest;
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

//  Program Use:

//Using the DevArt dbExpress driver 6.4.7.0 or higher in the same folder as this application,
// run this program on a system that has the Oracle 12.1.0 thick client installed
// against an Oracle 11g or Oracle 12c database.
//Fill in the connection information to your database.
//Run Task manager or Process Explorer and configure it to display handles.
//When clicking on the Main Thread Connection button the program connects to the database
// on the main thread.  This should not leak any threads or handles.
//When clicking on the Threaded Connection button the program connects to the database
// using a anonymous thread

procedure TForm1.ConnectionTest;
var
  sc :TSQLConnection;
begin
  sc := TSQLConnection.Create(nil);
  sc.DriverName := 'DevartOracle';
  sc.Params.Values['DATABASE'] := eDatabase.Text;
  sc.Params.Values['User_Name'] := eUserName.Text;
  sc.Params.Values['Password'] := ePassword.Text;
  sc.Connected := True;
  Sleep(1000);
  sc.Connected := False;
  sc.Free;
end;

procedure TForm1.btnMainThreadClick(Sender: TObject);
begin
  ConnectionTest;     //Does not leak handles with Oracle 12.1.0 client.
end;

procedure TForm1.btnThreadedClick(Sender: TObject);
begin
  TThread.CreateAnonymousThread(ConnectionTest).Start;  //Leaks 9 mutex handles with Oracle 12.1.0 client.
end;
{code}

Edited by: Jeff Chojnacki on Dec 12, 2014 11:47 AM

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 12-Dec-2014, at 11:47 AM EST
From: Jeff Chojnacki
 
Re: dbexpress compatible with Oracle 12c?  
News Group: embarcadero.public.delphi.database.dbexpress
Thanks for the reply Quinn.   
  I found the XE2 readme file and the online notes for XE6 dbExpress supported list.  Thanks.
  I tested again using the DevArt dbExpress driver for Oracle version 6.4.7 with Delphi XE6.  Oracle 12c support started with version 6.3.4.  I still see the same leak behavior. 
  Both test servers are using Oracle client 12.1.0.1.  I asked IT to upgrade one to 12.1.0.2 to see if there is a difference. 

  Unfortunately we are not converting to FireDAC until sometime next year using XE6 or higher.  So I can't do XE7 tests right now. 
  

> {quote:title=quinn wildman wrote:}{quote}
> Readme.htm tells you versions of Oracle are supported with DBExpress. 
> You'll note the highest Oracle version supported there is 11. So, while 
> DBExpress may work with 12, we have not tested it and promise nothing.
> 
> OTOH, FireDAC should work just fine and that is what I recommend you 
> investigate in more depth. However, if there is a problem, we certainly 
> would not update XE2 as it's too old. Any fix would come no early than 
> XE7, so you are well advised to try it first. If you find a FireDAC 
> problem with XE7 using Oracle 12, then I recommend you post to a FireDAC 
> newsgroup for more discussion.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 11-Dec-2014, at 2:23 PM EST
From: Jeff Chojnacki
 
Re: dbexpress compatible with Oracle 12c?  
News Group: embarcadero.public.delphi.database.dbexpress
Readme.htm tells you versions of Oracle are supported with DBExpress. 
You'll note the highest Oracle version supported there is 11. So, while 
DBExpress may work with 12, we have not tested it and promise nothing.

OTOH, FireDAC should work just fine and that is what I recommend you 
investigate in more depth. However, if there is a problem, we certainly 
would not update XE2 as it's too old. Any fix would come no early than 
XE7, so you are well advised to try it first. If you find a FireDAC 
problem with XE7 using Oracle 12, then I recommend you post to a FireDAC 
newsgroup for more discussion.

Jeff Chojnacki wrote:
> Using Delphi XE2, as far as I can tell dbExpress is compatible with Oracle 12c and the Oracle 12c Fat client.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 11-Dec-2014, at 11:20 AM EST
From: quinn wildman