Operation not working in ODAC 6
Posted: 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
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
I've made a workaround with this code
But if I change another option in my default Session I've to change this code too.[/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;
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
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;