Operation not working in ODAC 6

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
AlexandreECAD
Posts: 40
Joined: Wed 30 Nov 2005 15:55
Location: Brazil

Operation not working in ODAC 6

Post by AlexandreECAD » Tue 10 Apr 2007 02:42

In my application I've one default session and when a user opens a new screen I copy the TOraSession.Options contents from the default session to a new session in this new screen using this code

Code: Select all

procedure TdtmPrincipal.SetSessao(var ppSessao: TOraSession );
begin
  // db is my default session
  ppSessao.Server   := db.Server;
  ppSessao.Options.Assign(db.Options);
  ppSessao.Username := db.Username;
  ppSessao.Password := db.Password;
  ppSessao.Connect;
end;
This was woking fine but when I made the upgrade from version 5 I started to receive this error "Session is not connected" if I execute this command more than one time with the same TOraSession component like this

Code: Select all

var
  ora : TOraSession;
begin
 ora := TOraSession.Create();
 dtmPrincipal.SetSessao(ora);
 //.... Do some stuff
 ora.disconnect;
 dtmPrincipal.SetSessao(ora); <- I'm receiving the error here
  // ... do another stuff
I've made a workaround with this code

Code: Select all

procedure TdtmPrincipal.SetSessao(var ppSessao: TOraSession );
begin
  // db is my default session
  ppSessao.Server   := db.Server;
  //ppSessao.Options.Assign(db.Options);
  ppSessao.Options.DateFormat   := db.Options.DateFormat;
  ppSessao.Options.DateLanguage := db.Options.DateLanguage;
  ppSessao.Options.Direct       := db.Options.Direct;
  ppSessao.Connect;
end;
But if I change another option in my default Session I've to change this code too.[/code]

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 10 Apr 2007 09:01

We have fixed this problem. The fix will be included in the next build of ODAC.

Post Reply