TOraSession控件,连接ora后,闲置一段时间,再关闭或者做其他的查询操作会出错
如题,请问高手如何解决
[解决办法]
OraSession.Disconnect;
OraSession.Username := Account;
OraSession.Password := Password;
OraSession.Server := IP + ':' + PORT + ':' + SID;
OraSession.ConnectString := Account + '/' + Password + '@' + IP + ':' + PORT + ':' + SID;
OraSession.Connect;
//查询例子
With TOraQuery.Create(Application) do
Begin
AutoCommit := False;
FetchAll := True;
Session := OraSession;
Close;
Sql.Clear;
Sql.Add('select * from dual');
Open;
End;
个人从未发生过ToraQuery/TOraStoredproc等对象自动关闭Session的