folder Tahribat.com Forumları
linefolder Java
linefolder Callablestatement Heartbeat



Callablestatement Heartbeat

  1. KısayolKısayol reportŞikayet pmÖzel Mesaj
    trnight
    trnight's avatar
    Kayıt Tarihi: 21/Ocak/2013
    Erkek

    Müritler Selamlar,

     

    Javada CallableStatement ile bir DB prosodürü çağırıyorum. CallableStatement prosodürü tetiklediğinde prosodürün tamamlanması 1 saatten az ise tamamlandığında kod devam ediyor ve bir problem olmuyor. Fakat 1 saati geçtiğinde oracle sunucu bağlantı üzerinde hiç bir işlem yapılmadığı için bu bağlantıyı sonlandırıyor ve prosodürün tamamlandı bilgisi bana gelmiyor. CallableStatement'da heartbeat tanımlayabiliyor muyuz? Veya bu durumu nasıl aşabilirim fikri olan var mı? 

     

    Not: Ne yazık ki o 1 saati arttıramıyorum. 


    Bilgi güçtür...
  2. KısayolKısayol reportŞikayet pmÖzel Mesaj
    acemi-webci
    acemi-webci's avatar
    Kayıt Tarihi: 11/Haziran/2008
    Erkek

    hocam oracle bilmiyorum ama dbdir sonuçta :) genel geçer yöntem; prosedür dbde bir tabloya durumunu yazsın (başladı,bitti,çalışıyor,hata gibi), sen de aralıklarla oradan prosüdürün durumunu kontrol et.


    ...
  3. KısayolKısayol reportŞikayet pmÖzel Mesaj
    BiUyeOlamadim
    BiUyeOlamadim's avatar
    Kayıt Tarihi: 10/Eylül/2005
    Erkek

    ChatGPT önerileri:

     

    In Oracle, the server is responsible for managing and executing the procedures invoked through a "CallableStatement." By default, the server handles the procedure execution and returns the result to the client.

    To keep the Oracle server alive while using a "CallableStatement" procedure, you need to ensure that the connection to the database remains open. If the connection is closed, the server may release associated resources, and the session will be terminated. Here are some methods to keep the connection alive:

    1. Reuse the Connection: Instead of opening and closing the connection for each procedure call, you can reuse the same connection across multiple calls. This way, the connection remains active throughout the session.

    2. Connection Pooling: Implement connection pooling, which involves creating a pool of database connections and managing them efficiently. Connection pooling helps to reuse existing connections and reduces the overhead of creating new connections for each request.

    3. Set Connection Timeout: Configure the connection timeout appropriately. Ensure that the connection timeout is set to a higher value, so the connection remains open for a longer duration.

    4. Keep-Alive Queries: Periodically execute "keep-alive" queries to the database, even when there's no immediate work to be done. These queries can be simple, like fetching a constant value, just to keep the connection active.

    5. Handle Exceptions Gracefully: In case an exception occurs during the procedure execution, make sure to handle it properly to avoid unexpected disconnections.

    It's important to note that even with the above methods, there are still factors beyond your control, like network issues or server-side configurations that might lead to a connection being closed. Therefore, designing your application with error handling and connection re-establishment capabilities is essential for robustness.

    Remember that keeping connections open for an unnecessarily long time can lead to resource exhaustion on the server side, so finding an appropriate balance is crucial.


    The tip of the tongue taking a trip of three steps down the palate to tap, at three, on the teeth. Lo. Lee. Ta.
Toplam Hit: 785 Toplam Mesaj: 3
java callablestatement