1 Reply Latest reply: Sep 25, 2013 7:09 AM by Kmohan-Oracle RSS

    Statement Handle Reusing in OCCI




                 In OCCI there is a concept called statement handle reusing.

      Ex: stmt->setSQL(“INSERT INTO basket_tab VALUES(:1,:2)”);----------------------> in one thread

           stmt->setSQL(“SELECT * FROM basket_tab WHERE quantity >= :1”);---------------> in another thread


      Here we are reusing stmt.

      Can we do like this in case of multi-threading. What I mean is I am creating the Statement in the constructor of the class. I am creating an Object for the class and I am creating the two threads in each thread the object is calling a function of the class, in which  I am using the same statement I created in constructor  in these two threads which are executing in  parallel.

      Note: The class here I am using is singleton class.


      Please help me on this.