Database Lock while updating table in oracle





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















My aplication is performing a very simple update on a table :



UPDATE TABLE SET COLUMN = 'XYZ' WHERE PK = 123


The problem is, when Hibernate tries to update the table like this, the table get locked with
ORA event : SQL*Net more data from client.



I tried to replicate the error on my local database but i couldn't.



Does Anybody know what is happening?



Database's version where the error is happening: Oracle Database 10g Release 10.2.0.3.0 - 64bit Production



My local database's version: Oracle Database 10g Release 10.2.0.5.0 - 64bit Production



PS: The column being updated is a CLOB type and the OJDBC driver version is 1.4










share|improve this question























  • The shadow process has received part of a call from the client process (for example, SQLPlus, ProC, and JDBC) in the first network package and is waiting for more data for the call to be complete. Examples are large SQL or PL/SQL block and insert statements with large amounts of data.

    – Darshan Lila
    Jul 25 '14 at 14:39











  • A 101292 caracters lenght clob is being sent(this is the size of the value being setted in the column). Do you know how to fix it?

    – Jeyvison
    Jul 25 '14 at 17:22


















0















My aplication is performing a very simple update on a table :



UPDATE TABLE SET COLUMN = 'XYZ' WHERE PK = 123


The problem is, when Hibernate tries to update the table like this, the table get locked with
ORA event : SQL*Net more data from client.



I tried to replicate the error on my local database but i couldn't.



Does Anybody know what is happening?



Database's version where the error is happening: Oracle Database 10g Release 10.2.0.3.0 - 64bit Production



My local database's version: Oracle Database 10g Release 10.2.0.5.0 - 64bit Production



PS: The column being updated is a CLOB type and the OJDBC driver version is 1.4










share|improve this question























  • The shadow process has received part of a call from the client process (for example, SQLPlus, ProC, and JDBC) in the first network package and is waiting for more data for the call to be complete. Examples are large SQL or PL/SQL block and insert statements with large amounts of data.

    – Darshan Lila
    Jul 25 '14 at 14:39











  • A 101292 caracters lenght clob is being sent(this is the size of the value being setted in the column). Do you know how to fix it?

    – Jeyvison
    Jul 25 '14 at 17:22














0












0








0








My aplication is performing a very simple update on a table :



UPDATE TABLE SET COLUMN = 'XYZ' WHERE PK = 123


The problem is, when Hibernate tries to update the table like this, the table get locked with
ORA event : SQL*Net more data from client.



I tried to replicate the error on my local database but i couldn't.



Does Anybody know what is happening?



Database's version where the error is happening: Oracle Database 10g Release 10.2.0.3.0 - 64bit Production



My local database's version: Oracle Database 10g Release 10.2.0.5.0 - 64bit Production



PS: The column being updated is a CLOB type and the OJDBC driver version is 1.4










share|improve this question














My aplication is performing a very simple update on a table :



UPDATE TABLE SET COLUMN = 'XYZ' WHERE PK = 123


The problem is, when Hibernate tries to update the table like this, the table get locked with
ORA event : SQL*Net more data from client.



I tried to replicate the error on my local database but i couldn't.



Does Anybody know what is happening?



Database's version where the error is happening: Oracle Database 10g Release 10.2.0.3.0 - 64bit Production



My local database's version: Oracle Database 10g Release 10.2.0.5.0 - 64bit Production



PS: The column being updated is a CLOB type and the OJDBC driver version is 1.4







java database oracle hibernate






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jul 25 '14 at 14:35









JeyvisonJeyvison

98110




98110













  • The shadow process has received part of a call from the client process (for example, SQLPlus, ProC, and JDBC) in the first network package and is waiting for more data for the call to be complete. Examples are large SQL or PL/SQL block and insert statements with large amounts of data.

    – Darshan Lila
    Jul 25 '14 at 14:39











  • A 101292 caracters lenght clob is being sent(this is the size of the value being setted in the column). Do you know how to fix it?

    – Jeyvison
    Jul 25 '14 at 17:22



















  • The shadow process has received part of a call from the client process (for example, SQLPlus, ProC, and JDBC) in the first network package and is waiting for more data for the call to be complete. Examples are large SQL or PL/SQL block and insert statements with large amounts of data.

    – Darshan Lila
    Jul 25 '14 at 14:39











  • A 101292 caracters lenght clob is being sent(this is the size of the value being setted in the column). Do you know how to fix it?

    – Jeyvison
    Jul 25 '14 at 17:22

















The shadow process has received part of a call from the client process (for example, SQLPlus, ProC, and JDBC) in the first network package and is waiting for more data for the call to be complete. Examples are large SQL or PL/SQL block and insert statements with large amounts of data.

– Darshan Lila
Jul 25 '14 at 14:39





The shadow process has received part of a call from the client process (for example, SQLPlus, ProC, and JDBC) in the first network package and is waiting for more data for the call to be complete. Examples are large SQL or PL/SQL block and insert statements with large amounts of data.

– Darshan Lila
Jul 25 '14 at 14:39













A 101292 caracters lenght clob is being sent(this is the size of the value being setted in the column). Do you know how to fix it?

– Jeyvison
Jul 25 '14 at 17:22





A 101292 caracters lenght clob is being sent(this is the size of the value being setted in the column). Do you know how to fix it?

– Jeyvison
Jul 25 '14 at 17:22












2 Answers
2






active

oldest

votes


















0














Do you know what exactly is being sent to oracle db? I've seen something similar when Hibernate was sending very long sql command and it failed on JDBC driver.



I would suggest starting from getting latest JDBC driver version.






share|improve this answer
























  • A 101292 caracters lenght clob is being sent(this is the size of the value being setted in the column).

    – Jeyvison
    Jul 25 '14 at 17:21











  • How do you manage hibernate mapping? Could you send the configuration you use? Check also this: stephou.wordpress.com/2009/09/24/…

    – alobodzk
    Jul 25 '14 at 18:02











  • i updated my jdbc driver version to the most recent(in my case, ojdbc6) but it didnt fix my problem. I'm mapping the column(a CLOB in the database) as a String, more or less like this: <property name="content" type="java.lang.String" column="LO_CONTENT" />

    – Jeyvison
    Jul 29 '14 at 12:25













  • Ok, try something like this: <property name="content" type="java.sql.Clob" .. />, probably you have similar problem as here

    – alobodzk
    Jul 29 '14 at 13:48



















0














Prepared statement should be used. We should not directly assign the values.
For example:



String updateSQL = UPDATE TABLE SET COLUMN = ? WHERE PK = ? . 
PreparedStatement pstmt = null;
pstmt=dbresourceAgent.getPreparedStatement(updateSQL);
pstmt.setString(1,"XYZ");
pstmt.setString(2,"123");
pstmt.executeUpdate();





share|improve this answer


























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f24958214%2fdatabase-lock-while-updating-table-in-oracle%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Do you know what exactly is being sent to oracle db? I've seen something similar when Hibernate was sending very long sql command and it failed on JDBC driver.



    I would suggest starting from getting latest JDBC driver version.






    share|improve this answer
























    • A 101292 caracters lenght clob is being sent(this is the size of the value being setted in the column).

      – Jeyvison
      Jul 25 '14 at 17:21











    • How do you manage hibernate mapping? Could you send the configuration you use? Check also this: stephou.wordpress.com/2009/09/24/…

      – alobodzk
      Jul 25 '14 at 18:02











    • i updated my jdbc driver version to the most recent(in my case, ojdbc6) but it didnt fix my problem. I'm mapping the column(a CLOB in the database) as a String, more or less like this: <property name="content" type="java.lang.String" column="LO_CONTENT" />

      – Jeyvison
      Jul 29 '14 at 12:25













    • Ok, try something like this: <property name="content" type="java.sql.Clob" .. />, probably you have similar problem as here

      – alobodzk
      Jul 29 '14 at 13:48
















    0














    Do you know what exactly is being sent to oracle db? I've seen something similar when Hibernate was sending very long sql command and it failed on JDBC driver.



    I would suggest starting from getting latest JDBC driver version.






    share|improve this answer
























    • A 101292 caracters lenght clob is being sent(this is the size of the value being setted in the column).

      – Jeyvison
      Jul 25 '14 at 17:21











    • How do you manage hibernate mapping? Could you send the configuration you use? Check also this: stephou.wordpress.com/2009/09/24/…

      – alobodzk
      Jul 25 '14 at 18:02











    • i updated my jdbc driver version to the most recent(in my case, ojdbc6) but it didnt fix my problem. I'm mapping the column(a CLOB in the database) as a String, more or less like this: <property name="content" type="java.lang.String" column="LO_CONTENT" />

      – Jeyvison
      Jul 29 '14 at 12:25













    • Ok, try something like this: <property name="content" type="java.sql.Clob" .. />, probably you have similar problem as here

      – alobodzk
      Jul 29 '14 at 13:48














    0












    0








    0







    Do you know what exactly is being sent to oracle db? I've seen something similar when Hibernate was sending very long sql command and it failed on JDBC driver.



    I would suggest starting from getting latest JDBC driver version.






    share|improve this answer













    Do you know what exactly is being sent to oracle db? I've seen something similar when Hibernate was sending very long sql command and it failed on JDBC driver.



    I would suggest starting from getting latest JDBC driver version.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jul 25 '14 at 14:42









    alobodzkalobodzk

    5661720




    5661720













    • A 101292 caracters lenght clob is being sent(this is the size of the value being setted in the column).

      – Jeyvison
      Jul 25 '14 at 17:21











    • How do you manage hibernate mapping? Could you send the configuration you use? Check also this: stephou.wordpress.com/2009/09/24/…

      – alobodzk
      Jul 25 '14 at 18:02











    • i updated my jdbc driver version to the most recent(in my case, ojdbc6) but it didnt fix my problem. I'm mapping the column(a CLOB in the database) as a String, more or less like this: <property name="content" type="java.lang.String" column="LO_CONTENT" />

      – Jeyvison
      Jul 29 '14 at 12:25













    • Ok, try something like this: <property name="content" type="java.sql.Clob" .. />, probably you have similar problem as here

      – alobodzk
      Jul 29 '14 at 13:48



















    • A 101292 caracters lenght clob is being sent(this is the size of the value being setted in the column).

      – Jeyvison
      Jul 25 '14 at 17:21











    • How do you manage hibernate mapping? Could you send the configuration you use? Check also this: stephou.wordpress.com/2009/09/24/…

      – alobodzk
      Jul 25 '14 at 18:02











    • i updated my jdbc driver version to the most recent(in my case, ojdbc6) but it didnt fix my problem. I'm mapping the column(a CLOB in the database) as a String, more or less like this: <property name="content" type="java.lang.String" column="LO_CONTENT" />

      – Jeyvison
      Jul 29 '14 at 12:25













    • Ok, try something like this: <property name="content" type="java.sql.Clob" .. />, probably you have similar problem as here

      – alobodzk
      Jul 29 '14 at 13:48

















    A 101292 caracters lenght clob is being sent(this is the size of the value being setted in the column).

    – Jeyvison
    Jul 25 '14 at 17:21





    A 101292 caracters lenght clob is being sent(this is the size of the value being setted in the column).

    – Jeyvison
    Jul 25 '14 at 17:21













    How do you manage hibernate mapping? Could you send the configuration you use? Check also this: stephou.wordpress.com/2009/09/24/…

    – alobodzk
    Jul 25 '14 at 18:02





    How do you manage hibernate mapping? Could you send the configuration you use? Check also this: stephou.wordpress.com/2009/09/24/…

    – alobodzk
    Jul 25 '14 at 18:02













    i updated my jdbc driver version to the most recent(in my case, ojdbc6) but it didnt fix my problem. I'm mapping the column(a CLOB in the database) as a String, more or less like this: <property name="content" type="java.lang.String" column="LO_CONTENT" />

    – Jeyvison
    Jul 29 '14 at 12:25







    i updated my jdbc driver version to the most recent(in my case, ojdbc6) but it didnt fix my problem. I'm mapping the column(a CLOB in the database) as a String, more or less like this: <property name="content" type="java.lang.String" column="LO_CONTENT" />

    – Jeyvison
    Jul 29 '14 at 12:25















    Ok, try something like this: <property name="content" type="java.sql.Clob" .. />, probably you have similar problem as here

    – alobodzk
    Jul 29 '14 at 13:48





    Ok, try something like this: <property name="content" type="java.sql.Clob" .. />, probably you have similar problem as here

    – alobodzk
    Jul 29 '14 at 13:48













    0














    Prepared statement should be used. We should not directly assign the values.
    For example:



    String updateSQL = UPDATE TABLE SET COLUMN = ? WHERE PK = ? . 
    PreparedStatement pstmt = null;
    pstmt=dbresourceAgent.getPreparedStatement(updateSQL);
    pstmt.setString(1,"XYZ");
    pstmt.setString(2,"123");
    pstmt.executeUpdate();





    share|improve this answer






























      0














      Prepared statement should be used. We should not directly assign the values.
      For example:



      String updateSQL = UPDATE TABLE SET COLUMN = ? WHERE PK = ? . 
      PreparedStatement pstmt = null;
      pstmt=dbresourceAgent.getPreparedStatement(updateSQL);
      pstmt.setString(1,"XYZ");
      pstmt.setString(2,"123");
      pstmt.executeUpdate();





      share|improve this answer




























        0












        0








        0







        Prepared statement should be used. We should not directly assign the values.
        For example:



        String updateSQL = UPDATE TABLE SET COLUMN = ? WHERE PK = ? . 
        PreparedStatement pstmt = null;
        pstmt=dbresourceAgent.getPreparedStatement(updateSQL);
        pstmt.setString(1,"XYZ");
        pstmt.setString(2,"123");
        pstmt.executeUpdate();





        share|improve this answer















        Prepared statement should be used. We should not directly assign the values.
        For example:



        String updateSQL = UPDATE TABLE SET COLUMN = ? WHERE PK = ? . 
        PreparedStatement pstmt = null;
        pstmt=dbresourceAgent.getPreparedStatement(updateSQL);
        pstmt.setString(1,"XYZ");
        pstmt.setString(2,"123");
        pstmt.executeUpdate();






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 3 at 9:11









        Andrew Tobilko

        28.6k104591




        28.6k104591










        answered Jan 3 at 7:04









        ManojbabuChandrasekaranManojbabuChandrasekaran

        1




        1






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f24958214%2fdatabase-lock-while-updating-table-in-oracle%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

            SQL update select statement

            'app-layout' is not a known element: how to share Component with different Modules