Page 1 of 1

Operation not working in ODAC 6

Posted: Tue 10 Apr 2007 02:42
by AlexandreECAD
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]

Posted: Tue 10 Apr 2007 09:01
by Plash
We have fixed this problem. The fix will be included in the next build of ODAC.