1 Reply Latest reply: May 6, 2011 3:15 AM by 859285 RSS

    Thread hung using occi

    859285
      I use oracle Linux 6 (x86-64) and oracle 11g R2, I using multithread and StatelessConnectionPool access databse, the program run a moment,all thread are hung,this is gdb info:

      gdb > info threads
      8 Thread 0x7f753534b710 (LWP 16338) 0x00000032a6a0e034 in __lll_lock_wait () from /lib64/libpthread.so.0
      7 Thread 0x7f7534b4a710 (LWP 16339) 0x00000032a6a0e034 in __lll_lock_wait () from /lib64/libpthread.so.0
      6 Thread 0x7f752ffff710 (LWP 16340) 0x00000032a6a0e034 in __lll_lock_wait () from /lib64/libpthread.so.0
      5 Thread 0x7f752f7fe710 (LWP 16341) 0x00007f75379ab679 in kpucpgettime ()
      4 Thread 0x7f752effd710 (LWP 16342) 0x00000032a6a0e034 in __lll_lock_wait () from /lib64/libpthread.so.0
      3 Thread 0x7f752e7fc710 (LWP 16343) 0x00000032a6a0e034 in __lll_lock_wait () from /lib64/libpthread.so.0

      gdb> thread 5
      gdb> bt
      #0 0x00007f7536e192a8 in kpucpgettime@plt () from /u01/app/oracle/product/11.1.0/db_1/lib/libclntsh.so.11.1
      #1 0x00007f75379b2a43 in kpuspclnfree () from /u01/app/oracle/product/11.1.0/db_1/lib/libclntsh.so.11.1
      #2 0x00007f75379b75a7 in kpuspreltopool () from /u01/app/oracle/product/11.1.0/db_1/lib/libclntsh.so.11.1
      #3 0x00007f75379b88aa in kpuspsessionrelease () from /u01/app/oracle/product/11.1.0/db_1/lib/libclntsh.so.11.1
      #4 0x00007f75377ee09d in OCISessionRelease () from /u01/app/oracle/product/11.1.0/db_1/lib/libclntsh.so.11.1
      #5 0x00007f7539088ee3 in oracle::occi::ConnectionImpl::do_destroy(unsigned int, void*, unsigned int) ()
      from /u01/app/oracle/product/11.1.0/db_1/lib/libocci.so.11.1
      #6 0x00007f7539088f69 in oracle::occi::ConnectionImpl::destroy(unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /u01/app/oracle/product/11.1.0/db_1/lib/libocci.so.11.1
      #7 0x00007f75390b94bd in oracle::occi::StatelessConnectionPoolImpl::releaseConnection(oracle::occi::Connection*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /u01/app/oracle/product/11.1.0/db_1/lib/libocci.so.11.1
      gdb> thread 8
      gdb> bt
      #0 0x00000032a6a0e034 in __lll_lock_wait () from /lib64/libpthread.so.0
      #1 0x00000032a6a09345 in Llock_870 () from /lib64/libpthread.so.0
      #2 0x00000032a6a09217 in pthread_mutex_lock () from /lib64/libpthread.so.0
      #3 0x00007f75387ae2df in sltsmna () from /u01/app/oracle/product/11.1.0/db_1/lib/libclntsh.so.11.1
      #4 0x00007f75379b7c4b in kpuspreltopool () from /u01/app/oracle/product/11.1.0/db_1/lib/libclntsh.so.11.1
      #5 0x00007f75379b88aa in kpuspsessionrelease () from /u01/app/oracle/product/11.1.0/db_1/lib/libclntsh.so.11.1
      #6 0x00007f75377ee09d in OCISessionRelease () from /u01/app/oracle/product/11.1.0/db_1/lib/libclntsh.so.11.1
      #7 0x00007f7539088ee3 in oracle::occi::ConnectionImpl::do_destroy(unsigned int, void*, unsigned int) ()
      from /u01/app/oracle/product/11.1.0/db_1/lib/libocci.so.11.1
      #8 0x00007f7539088f69 in oracle::occi::ConnectionImpl::destroy(unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /u01/app/oracle/product/11.1.0/db_1/lib/libocci.so.11.1
      #9 0x00007f75390b94bd in oracle::occi::StatelessConnectionPoolImpl::releaseConnection(oracle::occi::Connection*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /u01/app/oracle/product/11.1.0/db_1/lib/libocci.so.11.1

      the code of StatelessConnectionPool create:
           env = Environment::createEnvironment ((Environment::Mode)((Environment::THREADED_MUTEXED)|(Environment::OBJECT)));
           scPool = env->createStatelessConnectionPool(user,passwd,connStr, maxConn, minConn, incrConn, StatelessConnectionPool::HOMOGENEOUS);
           scPool->setTimeOut(180);
           scPool->setBusyOption(StatelessConnectionPool::WAIT);

      what is wrong,help me!! Thanks!!

      Edited by: user4230416 on 2011-5-3 上午8:50

      Edited by: user4230416 on 2011-5-3 上午8:57
        • 1. Re: Thread hung using occi
          859285
          close scPool->setTimeOut(180);,then run ok, I think this is a oracle bug;
          env = Environment::createEnvironment ((Environment::Mode)((Environment::THREADED_MUTEXED)|(Environment::OBJECT)));
          scPool = env->createStatelessConnectionPool(user,passwd,connStr, maxConn, minConn, incrConn, StatelessConnectionPool::HOMOGENEOUS);
          //scPool->setTimeOut(180);
          scPool->setBusyOption(StatelessConnectionPool::WAIT);