2016-05-26 14 views

答えて

0

一定のアイドル時間が経過した後にアクティビティがあることを確認して、データベース接続をアクティブに保つ必要があります。

//In the Open Event of a window that will be running for a long time 
//Sets Idle Time 
Idle(600) 

次に、アプリケーションオブジェクトの「IDLE」イベントにコードを追加します。

int li_site 

//Runs a simple query to see if we are still connected to the database 
select current_site 
    into :li_site 
    from comp_settings; 

//Not connected 
if (SQLCA.SQLCode <> 0) then 

    //Connects to the DB 
    Connect using sqlca; 

end if 

次に、アイドルタイマーをオフにすることを忘れないでください。

//In the Close Event of a window 
//Turns off Idle Time 
Idle(0) 
+0

ありがとうございました。はい、コメントごとに、Powerbuilderコードで接続をアクティブに保つことができます。しかし、私はPB(DBプロファイル接続)のisqlセッションツールについて話しています。 – Shiras

+0

これはデータベース接続のアイドル設定のままです。 [詳細オプション]または[詳細設定]セクションを参照してください。 「アイドル」または「アイドルセッション」のオプションがあります。そこに番号0を入れて、アイドルタイムアウトチェックをオフにします。 –

関連する問題