cx-oracle-users Mailing List for cx_Oracle (Page 22)
Brought to you by:
atuining
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(9) |
Sep
(8) |
Oct
(12) |
Nov
(4) |
Dec
(8) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(15) |
Feb
(12) |
Mar
(11) |
Apr
(5) |
May
(7) |
Jun
(8) |
Jul
(12) |
Aug
(2) |
Sep
(14) |
Oct
(17) |
Nov
(20) |
Dec
(3) |
2005 |
Jan
(16) |
Feb
(9) |
Mar
(22) |
Apr
(21) |
May
(73) |
Jun
(16) |
Jul
(15) |
Aug
(10) |
Sep
(32) |
Oct
(35) |
Nov
(22) |
Dec
(13) |
2006 |
Jan
(42) |
Feb
(36) |
Mar
(13) |
Apr
(18) |
May
(8) |
Jun
(17) |
Jul
(24) |
Aug
(30) |
Sep
(35) |
Oct
(33) |
Nov
(33) |
Dec
(11) |
2007 |
Jan
(35) |
Feb
(31) |
Mar
(35) |
Apr
(64) |
May
(38) |
Jun
(12) |
Jul
(18) |
Aug
(34) |
Sep
(75) |
Oct
(29) |
Nov
(51) |
Dec
(11) |
2008 |
Jan
(27) |
Feb
(46) |
Mar
(48) |
Apr
(36) |
May
(59) |
Jun
(42) |
Jul
(25) |
Aug
(34) |
Sep
(57) |
Oct
(97) |
Nov
(59) |
Dec
(57) |
2009 |
Jan
(48) |
Feb
(48) |
Mar
(45) |
Apr
(24) |
May
(46) |
Jun
(52) |
Jul
(52) |
Aug
(37) |
Sep
(27) |
Oct
(40) |
Nov
(37) |
Dec
(13) |
2010 |
Jan
(16) |
Feb
(9) |
Mar
(24) |
Apr
(6) |
May
(27) |
Jun
(28) |
Jul
(60) |
Aug
(16) |
Sep
(33) |
Oct
(20) |
Nov
(39) |
Dec
(30) |
2011 |
Jan
(23) |
Feb
(43) |
Mar
(16) |
Apr
(29) |
May
(23) |
Jun
(16) |
Jul
(10) |
Aug
(8) |
Sep
(18) |
Oct
(42) |
Nov
(26) |
Dec
(20) |
2012 |
Jan
(17) |
Feb
(27) |
Mar
|
Apr
(20) |
May
(18) |
Jun
(7) |
Jul
(24) |
Aug
(21) |
Sep
(23) |
Oct
(18) |
Nov
(12) |
Dec
(5) |
2013 |
Jan
(14) |
Feb
(10) |
Mar
(20) |
Apr
(65) |
May
(3) |
Jun
(8) |
Jul
(6) |
Aug
(3) |
Sep
|
Oct
(3) |
Nov
(28) |
Dec
(3) |
2014 |
Jan
(3) |
Feb
(9) |
Mar
(4) |
Apr
(7) |
May
(20) |
Jun
(2) |
Jul
(20) |
Aug
(7) |
Sep
(11) |
Oct
(8) |
Nov
(6) |
Dec
(12) |
2015 |
Jan
(16) |
Feb
(10) |
Mar
(14) |
Apr
(8) |
May
|
Jun
(8) |
Jul
(15) |
Aug
(7) |
Sep
(1) |
Oct
(33) |
Nov
(8) |
Dec
(5) |
2016 |
Jan
(18) |
Feb
(12) |
Mar
(6) |
Apr
(14) |
May
(5) |
Jun
(3) |
Jul
|
Aug
(21) |
Sep
|
Oct
(15) |
Nov
(8) |
Dec
|
2017 |
Jan
|
Feb
(14) |
Mar
(21) |
Apr
(9) |
May
(6) |
Jun
(11) |
Jul
(23) |
Aug
(6) |
Sep
(5) |
Oct
(7) |
Nov
(1) |
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
(16) |
Apr
(2) |
May
(1) |
Jun
|
Jul
(2) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2019 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
2020 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
(2) |
Jun
(1) |
Jul
(4) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(3) |
2021 |
Jan
|
Feb
(5) |
Mar
|
Apr
(7) |
May
(6) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Ivanelson N. <iva...@gm...> - 2013-11-27 04:14:09
|
I decided to reinstall gcc. I installed version 4.8.2. After that I tried again to install cx_Oracle. The error message has changed: bash-4.2$ pwd ; python -V >> /opt/cx_Oracle-5.1.2 >> Python 2.7.5 >> bash-4.2$ python setup.py install >> running install >> running build >> running build_ext >> building 'cx_Oracle' extension >> gcc -DNDEBUG -O -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 >> -D_AIX52 -D_AIX53 -D_AIX61 -D_ALL_SOURCE -DFUNCPROTO=15 -O >> -I/opt/freeware/include -I/usr/lib/instantclient_11_2/sdk/include >> -I/opt/freeware/include/python2.7 -c cx_Oracle.c -o >> build/temp.aix-6.1-2.7-11g/cx_Oracle.o -DBUILD_VERSION=5.1.2 >> ./Modules/ld_so_aix xlc_r -ma -I/opt/freeware/include >> -DAIX_GENUINE_CPLUSCPLUS -Wl,-brtl -bI:./Modules/python.exp >> -L/opt/freeware/lib -L/opt/freeware/lib64 -L/opt/freeware/lib >> -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib >> -Wl,-bmaxdata:0x80000000 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 >> -D_AIX52 -D_AIX53 -D_AIX61 -D_ALL_SOURCE -DFUNCPROTO=15 -O >> -I/opt/freeware/include build/temp.aix-6.1-2.7-11g/cx_Oracle.o >> -L/usr/lib/instantclient_11_2 -lclntsh -o >> build/lib.aix-6.1-2.7-11g/cx_Oracle.so >> > unable to execute ./Modules/ld_so_aix: No such file or directory > error: command './Modules/ld_so_aix' failed with exit status 1 > Help me please. @ivanelson []s 2013/11/26 Anurag Chourasia <anu...@gm...> > What problems are you facing? What errors are you getting? > > To get help, you need to help us with more Information. > > Regards, > Anurag > On Nov 26, 2013 8:14 PM, "Ivanelson Nunes" <iva...@gm...> > wrote: > >> In my AIX 6.1 I have not installed xlc/xlc_r. I think the xlc is >> purchased separately. >> >> I get the Python-2.7.5 RPM's for the Perzl [1]. >> >> And've tried installing cx_Oracle and I can not. >> >> I have also tried via gcc (export CC = gcc). >> >> Any tips please? >> >> [1] http://www.perzl.org/aix/ >> >> @ivanelson >> []s >> >> >> 2013/11/25 Kristian Berg <kr...@ti...> >> >>> On 25.11.2013 15:18, Ivanelson Nunes wrote: >>> >>> I want to install cx_Oracle - 5.1.2 on AIX 6 , however I got an error : >>> >>> >>>> bash -4.2 $ python setup.py install >>>> / usr/lib/instantclient_11_2 >>>> running install >>>> running build >>>> running build_ext >>>> building ' cx_Oracle ' extension >>>> xlc_r - ma - -I/opt/freeware/include DAIX_GENUINE_CPLUSCPLUS -Wl , - >>>> brtl - qmaxmem = 16384 - DSYSV - D_AIX - D_AIX32 - D_AIX41 - D_AIX43 - >>>> D_AIX51 - D_AIX52 - D_AIX53 - D_AIX61 - D_ALL_SOURCE - DFUNCPROTO = 15-O -I >>>> / opt / freeware / include - DNDEBUG -O - c >>>> -I/usr/lib/instantclient_11_2/sdk/include -I/opt/freeware/include/python2.7 >>>> cx_Oracle.c it build/temp.aix-6.1-2.7 -11g/cx_Oracle.o = 5.1.2 - >>>> DBUILD_VERSION >>>> Unable to run xlc_r : No such file or directory >>>> error : command ' xlc_r ' failed with exit status 1 >>> >>> >>> How do I change " xlc_e " by " gcc " . >>> >>> # oslevel - s >>> 6100-06-06-1140 >>> >>> # lslpp - ch | grep -i xlc >>> / usr / lib / objrepos : xlC.aix61.rte : 11.1.0.1 :: COMMIT : COMPLETE : >>> 05/20/11 : 07 , 32, 06 >>> / usr / lib / objrepos : xlC.cpp : 9.0.0.0 :: COMMIT : COMPLETE : >>> 05/19/11 : 16 , 27, 09 >>> / usr / lib / objrepos : xlC.msg.en_US.cpp : 9.0.0.0 :: COMMIT : >>> COMPLETE : 05/19/11 : 16 , 49, 30 >>> / usr / lib / objrepos : xlC.msg.en_US.rte : 11.1.0.1 :: COMMIT : >>> COMPLETE : 05/20/11 : 08 , 02 , 45 >>> / usr / lib / objrepos : xlC.rte : 11.1.0.1 :: COMMIT : COMPLETE : >>> 05/20/11 : 08 , 02 , 43 >>> / usr / lib / objrepos : xlC.sup.aix50.rte : 9.0.0.1 :: COMMIT : >>> COMPLETE : 05/19/11 : 15 , 45, 49 >>> >>> >>> I use this shell environment when compiling on AIX: >>> export CC=gcc >>> export CXX=g++ >>> export F77=xlf >>> export FFLAGS="-O -I/opt/freeware/include" >>> export LD=ld >>> export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" >>> >>> >>> export CFLAGS="-maix64 -g -mminimal-toc -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_ALL_SOURCE -DFUNCPROTO=15 -O2 -I/opt/freeware/include" >>> export CXXFLAGS=$CFLAGS >>> export OBJECT_MODE=64 >>> >>> You should at least set the CC variable to gcc. I use the gcc RPMs distributed from perzl.org to compile. >>> >>> >>> -- >>> [Kristian Berg] >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Shape the Mobile Experience: Free Subscription >>> Software experts and developers: Be at the forefront of tech innovation. >>> Intel(R) Software Adrenaline delivers strategic insight and game-changing >>> conversations that shape the rapidly evolving mobile landscape. Sign up >>> now. >>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> cx-oracle-users mailing list >>> cx-...@li... >>> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >>> >>> >> >> >> ------------------------------------------------------------------------------ >> Rapidly troubleshoot problems before they affect your business. Most IT >> organizations don't have a clear picture of how application performance >> affects their revenue. With AppDynamics, you get 100% visibility into your >> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics >> Pro! >> >> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk >> >> _______________________________________________ >> cx-oracle-users mailing list >> cx-...@li... >> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >> >> > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics > Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |
From: Ivanelson N. <iva...@gm...> - 2013-11-26 23:34:57
|
Hi Anurag, My OS is AIX 6.1 : # Oslevel - s 6100-06-06-1140 I'm using Python - 2.7.5 , downloaded at: . http://www.perzl.org/aix/index.php?n=Main.Python I've tried using gcc low . With these settings : export CONFIG_SHELL=/opt/freeware/bin/bash > export CONFIG_ENV_ARGS=/opt/freeware/bin/bash > export CC=gcc > export CFLAGS="-DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 > -D_AIX53 -D_AIX61 \ > -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include" > export CXX=g++ > export CXXFLAGS=$CFLAGS > export F77=xlf > export FFLAGS="-O -I/opt/freeware/include" > export LD=ld > # for 64-bit applications > export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib \ > > -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib > -Wl,-bmaxdata:0x80000000" > export > PATH=/usr/bin:/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/vac/bin:/usr/vacpp/bin:/usr/ccs/bin:/usr/dt/bin:/usr/opt/perl5/bin:/opt/freeware/bin:/opt/freeware/sbin:/usr/local/bin:/usr/lib/instl:$LD_LIBRARY_PATH That same server I can use SQLPlus . When I do : $ Python setup.py install Check out: cx_Oracle.c: At top level: > cx_Oracle.c:205: error: expected '=', ',', ';', 'asm' or '__attribute__' > before '*' token > cx_Oracle.c:249: error: expected '=', ',', ';', 'asm' or '__attribute__' > before '*' token > cx_Oracle.c:267: error: expected '=', ',', ';', 'asm' or '__attribute__' > before '*' token > cx_Oracle.c:281: error: expected '=', ',', ';', 'asm' or '__attribute__' > before '*' token > cx_Oracle.c:295: error: expected '=', ',', ';', 'asm' or '__attribute__' > before '*' token > cx_Oracle.c:307: error: expected '=', ',', ';', 'asm' or '__attribute__' > before '*' token > cx_Oracle.c:318: error: expected '=', ',', ';', 'asm' or '__attribute__' > before 'g_ModuleMethods' > cx_Oracle.c:353: error: expected '=', ',', ';', 'asm' or '__attribute__' > before '*' token > error: command 'gcc' failed with exit status 1 @ivanelson []s 2013/11/26 Anurag Chourasia <anu...@gm...> > What problems are you facing? What errors are you getting? > > To get help, you need to help us with more Information. > > Regards, > Anurag > On Nov 26, 2013 8:14 PM, "Ivanelson Nunes" <iva...@gm...> > wrote: > >> In my AIX 6.1 I have not installed xlc/xlc_r. I think the xlc is >> purchased separately. >> >> I get the Python-2.7.5 RPM's for the Perzl [1]. >> >> And've tried installing cx_Oracle and I can not. >> >> I have also tried via gcc (export CC = gcc). >> >> Any tips please? >> >> [1] http://www.perzl.org/aix/ >> >> @ivanelson >> []s >> >> >> 2013/11/25 Kristian Berg <kr...@ti...> >> >>> On 25.11.2013 15:18, Ivanelson Nunes wrote: >>> >>> I want to install cx_Oracle - 5.1.2 on AIX 6 , however I got an error : >>> >>> >>>> bash -4.2 $ python setup.py install >>>> / usr/lib/instantclient_11_2 >>>> running install >>>> running build >>>> running build_ext >>>> building ' cx_Oracle ' extension >>>> xlc_r - ma - -I/opt/freeware/include DAIX_GENUINE_CPLUSCPLUS -Wl , - >>>> brtl - qmaxmem = 16384 - DSYSV - D_AIX - D_AIX32 - D_AIX41 - D_AIX43 - >>>> D_AIX51 - D_AIX52 - D_AIX53 - D_AIX61 - D_ALL_SOURCE - DFUNCPROTO = 15-O -I >>>> / opt / freeware / include - DNDEBUG -O - c >>>> -I/usr/lib/instantclient_11_2/sdk/include -I/opt/freeware/include/python2.7 >>>> cx_Oracle.c it build/temp.aix-6.1-2.7 -11g/cx_Oracle.o = 5.1.2 - >>>> DBUILD_VERSION >>>> Unable to run xlc_r : No such file or directory >>>> error : command ' xlc_r ' failed with exit status 1 >>> >>> >>> How do I change " xlc_e " by " gcc " . >>> >>> # oslevel - s >>> 6100-06-06-1140 >>> >>> # lslpp - ch | grep -i xlc >>> / usr / lib / objrepos : xlC.aix61.rte : 11.1.0.1 :: COMMIT : COMPLETE : >>> 05/20/11 : 07 , 32, 06 >>> / usr / lib / objrepos : xlC.cpp : 9.0.0.0 :: COMMIT : COMPLETE : >>> 05/19/11 : 16 , 27, 09 >>> / usr / lib / objrepos : xlC.msg.en_US.cpp : 9.0.0.0 :: COMMIT : >>> COMPLETE : 05/19/11 : 16 , 49, 30 >>> / usr / lib / objrepos : xlC.msg.en_US.rte : 11.1.0.1 :: COMMIT : >>> COMPLETE : 05/20/11 : 08 , 02 , 45 >>> / usr / lib / objrepos : xlC.rte : 11.1.0.1 :: COMMIT : COMPLETE : >>> 05/20/11 : 08 , 02 , 43 >>> / usr / lib / objrepos : xlC.sup.aix50.rte : 9.0.0.1 :: COMMIT : >>> COMPLETE : 05/19/11 : 15 , 45, 49 >>> >>> >>> I use this shell environment when compiling on AIX: >>> export CC=gcc >>> export CXX=g++ >>> export F77=xlf >>> export FFLAGS="-O -I/opt/freeware/include" >>> export LD=ld >>> export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" >>> >>> >>> export CFLAGS="-maix64 -g -mminimal-toc -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_ALL_SOURCE -DFUNCPROTO=15 -O2 -I/opt/freeware/include" >>> export CXXFLAGS=$CFLAGS >>> export OBJECT_MODE=64 >>> >>> You should at least set the CC variable to gcc. I use the gcc RPMs distributed from perzl.org to compile. >>> >>> >>> -- >>> [Kristian Berg] >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Shape the Mobile Experience: Free Subscription >>> Software experts and developers: Be at the forefront of tech innovation. >>> Intel(R) Software Adrenaline delivers strategic insight and game-changing >>> conversations that shape the rapidly evolving mobile landscape. Sign up >>> now. >>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> cx-oracle-users mailing list >>> cx-...@li... >>> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >>> >>> >> >> >> ------------------------------------------------------------------------------ >> Rapidly troubleshoot problems before they affect your business. Most IT >> organizations don't have a clear picture of how application performance >> affects their revenue. With AppDynamics, you get 100% visibility into your >> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics >> Pro! >> >> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk >> >> _______________________________________________ >> cx-oracle-users mailing list >> cx-...@li... >> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >> >> > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics > Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |
From: Anurag C. <anu...@gm...> - 2013-11-26 23:21:44
|
What problems are you facing? What errors are you getting? To get help, you need to help us with more Information. Regards, Anurag On Nov 26, 2013 8:14 PM, "Ivanelson Nunes" <iva...@gm...> wrote: > In my AIX 6.1 I have not installed xlc/xlc_r. I think the xlc is purchased > separately. > > I get the Python-2.7.5 RPM's for the Perzl [1]. > > And've tried installing cx_Oracle and I can not. > > I have also tried via gcc (export CC = gcc). > > Any tips please? > > [1] http://www.perzl.org/aix/ > > @ivanelson > []s > > > 2013/11/25 Kristian Berg <kr...@ti...> > >> On 25.11.2013 15:18, Ivanelson Nunes wrote: >> >> I want to install cx_Oracle - 5.1.2 on AIX 6 , however I got an error : >> >> >>> bash -4.2 $ python setup.py install >>> / usr/lib/instantclient_11_2 >>> running install >>> running build >>> running build_ext >>> building ' cx_Oracle ' extension >>> xlc_r - ma - -I/opt/freeware/include DAIX_GENUINE_CPLUSCPLUS -Wl , - >>> brtl - qmaxmem = 16384 - DSYSV - D_AIX - D_AIX32 - D_AIX41 - D_AIX43 - >>> D_AIX51 - D_AIX52 - D_AIX53 - D_AIX61 - D_ALL_SOURCE - DFUNCPROTO = 15-O -I >>> / opt / freeware / include - DNDEBUG -O - c >>> -I/usr/lib/instantclient_11_2/sdk/include -I/opt/freeware/include/python2.7 >>> cx_Oracle.c it build/temp.aix-6.1-2.7 -11g/cx_Oracle.o = 5.1.2 - >>> DBUILD_VERSION >>> Unable to run xlc_r : No such file or directory >>> error : command ' xlc_r ' failed with exit status 1 >> >> >> How do I change " xlc_e " by " gcc " . >> >> # oslevel - s >> 6100-06-06-1140 >> >> # lslpp - ch | grep -i xlc >> / usr / lib / objrepos : xlC.aix61.rte : 11.1.0.1 :: COMMIT : COMPLETE : >> 05/20/11 : 07 , 32, 06 >> / usr / lib / objrepos : xlC.cpp : 9.0.0.0 :: COMMIT : COMPLETE : >> 05/19/11 : 16 , 27, 09 >> / usr / lib / objrepos : xlC.msg.en_US.cpp : 9.0.0.0 :: COMMIT : COMPLETE >> : 05/19/11 : 16 , 49, 30 >> / usr / lib / objrepos : xlC.msg.en_US.rte : 11.1.0.1 :: COMMIT : >> COMPLETE : 05/20/11 : 08 , 02 , 45 >> / usr / lib / objrepos : xlC.rte : 11.1.0.1 :: COMMIT : COMPLETE : >> 05/20/11 : 08 , 02 , 43 >> / usr / lib / objrepos : xlC.sup.aix50.rte : 9.0.0.1 :: COMMIT : COMPLETE >> : 05/19/11 : 15 , 45, 49 >> >> >> I use this shell environment when compiling on AIX: >> export CC=gcc >> export CXX=g++ >> export F77=xlf >> export FFLAGS="-O -I/opt/freeware/include" >> export LD=ld >> export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" >> >> export CFLAGS="-maix64 -g -mminimal-toc -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_ALL_SOURCE -DFUNCPROTO=15 -O2 -I/opt/freeware/include" >> export CXXFLAGS=$CFLAGS >> export OBJECT_MODE=64 >> >> You should at least set the CC variable to gcc. I use the gcc RPMs distributed from perzl.org to compile. >> >> -- >> [Kristian Berg] >> >> >> >> ------------------------------------------------------------------------------ >> Shape the Mobile Experience: Free Subscription >> Software experts and developers: Be at the forefront of tech innovation. >> Intel(R) Software Adrenaline delivers strategic insight and game-changing >> conversations that shape the rapidly evolving mobile landscape. Sign up >> now. >> >> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk >> _______________________________________________ >> cx-oracle-users mailing list >> cx-...@li... >> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >> >> > > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics > Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |
From: Ivanelson N. <iva...@gm...> - 2013-11-26 23:13:19
|
In my AIX 6.1 I have not installed xlc/xlc_r. I think the xlc is purchased separately. I get the Python-2.7.5 RPM's for the Perzl [1]. And've tried installing cx_Oracle and I can not. I have also tried via gcc (export CC = gcc). Any tips please? [1] http://www.perzl.org/aix/ @ivanelson []s 2013/11/25 Kristian Berg <kr...@ti...> > On 25.11.2013 15:18, Ivanelson Nunes wrote: > > I want to install cx_Oracle - 5.1.2 on AIX 6 , however I got an error : > > >> bash -4.2 $ python setup.py install >> / usr/lib/instantclient_11_2 >> running install >> running build >> running build_ext >> building ' cx_Oracle ' extension >> xlc_r - ma - -I/opt/freeware/include DAIX_GENUINE_CPLUSCPLUS -Wl , - brtl >> - qmaxmem = 16384 - DSYSV - D_AIX - D_AIX32 - D_AIX41 - D_AIX43 - D_AIX51 - >> D_AIX52 - D_AIX53 - D_AIX61 - D_ALL_SOURCE - DFUNCPROTO = 15-O -I / opt / >> freeware / include - DNDEBUG -O - c >> -I/usr/lib/instantclient_11_2/sdk/include -I/opt/freeware/include/python2.7 >> cx_Oracle.c it build/temp.aix-6.1-2.7 -11g/cx_Oracle.o = 5.1.2 - >> DBUILD_VERSION >> Unable to run xlc_r : No such file or directory >> error : command ' xlc_r ' failed with exit status 1 > > > How do I change " xlc_e " by " gcc " . > > # oslevel - s > 6100-06-06-1140 > > # lslpp - ch | grep -i xlc > / usr / lib / objrepos : xlC.aix61.rte : 11.1.0.1 :: COMMIT : COMPLETE : > 05/20/11 : 07 , 32, 06 > / usr / lib / objrepos : xlC.cpp : 9.0.0.0 :: COMMIT : COMPLETE : 05/19/11 > : 16 , 27, 09 > / usr / lib / objrepos : xlC.msg.en_US.cpp : 9.0.0.0 :: COMMIT : COMPLETE > : 05/19/11 : 16 , 49, 30 > / usr / lib / objrepos : xlC.msg.en_US.rte : 11.1.0.1 :: COMMIT : COMPLETE > : 05/20/11 : 08 , 02 , 45 > / usr / lib / objrepos : xlC.rte : 11.1.0.1 :: COMMIT : COMPLETE : > 05/20/11 : 08 , 02 , 43 > / usr / lib / objrepos : xlC.sup.aix50.rte : 9.0.0.1 :: COMMIT : COMPLETE > : 05/19/11 : 15 , 45, 49 > > > I use this shell environment when compiling on AIX: > export CC=gcc > export CXX=g++ > export F77=xlf > export FFLAGS="-O -I/opt/freeware/include" > export LD=ld > export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" > export CFLAGS="-maix64 -g -mminimal-toc -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_ALL_SOURCE -DFUNCPROTO=15 -O2 -I/opt/freeware/include" > export CXXFLAGS=$CFLAGS > export OBJECT_MODE=64 > > You should at least set the CC variable to gcc. I use the gcc RPMs distributed from perzl.org to compile. > > -- > [Kristian Berg] > > > > ------------------------------------------------------------------------------ > Shape the Mobile Experience: Free Subscription > Software experts and developers: Be at the forefront of tech innovation. > Intel(R) Software Adrenaline delivers strategic insight and game-changing > conversations that shape the rapidly evolving mobile landscape. Sign up > now. > http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |
From: Ivanelson N. <iva...@gm...> - 2013-11-25 16:41:17
|
Kristian Berg, I feel that the solution is near . see : SessionPool.c : 527 : error : ' udt_SessionPool ' has no member named ' > environment ' > SessionPool.c : 528 : error : ' udt_SessionPool ' has no member named ' > environment ' > cx_Oracle.c : At top level: > cx_Oracle.c : 205 : error : expected '=' , ',' , ' , ', ' asm ' or ' > __attribute__ ' before ' * ' token > cx_Oracle.c : 249 : error : expected '=' , ',' , ' , ', ' asm ' or ' > __attribute__ ' before ' * ' token > cx_Oracle.c : 267 : error : expected '=' , ',' , ' , ', ' asm ' or ' > __attribute__ ' before ' * ' token > cx_Oracle.c : 281 : error : expected '=' , ',' , ' , ', ' asm ' or ' > __attribute__ ' before ' * ' token > cx_Oracle.c : 295 : error : expected '=' , ',' , ' , ', ' asm ' or ' > __attribute__ ' before ' * ' token > cx_Oracle.c : 307 : error : expected '=' , ',' , ' , ', ' asm ' or ' > __attribute__ ' before ' * ' token > cx_Oracle.c : 318 : error : expected '=' , ',' , ' , ', ' asm ' or ' > __attribute__ ' before ' g_ModuleMethods ' > cx_Oracle.c : 353 : error : expected '=' , ',' , ' , ', ' asm ' or ' > __attribute__ ' before ' * ' token > error : command ' gcc' failed with exit status 1 > @ivanelson []s 2013/11/25 Kristian Berg <kr...@ti...> > On 25.11.2013 15:18, Ivanelson Nunes wrote: > > I want to install cx_Oracle - 5.1.2 on AIX 6 , however I got an error : > > >> bash -4.2 $ python setup.py install >> / usr/lib/instantclient_11_2 >> running install >> running build >> running build_ext >> building ' cx_Oracle ' extension >> xlc_r - ma - -I/opt/freeware/include DAIX_GENUINE_CPLUSCPLUS -Wl , - brtl >> - qmaxmem = 16384 - DSYSV - D_AIX - D_AIX32 - D_AIX41 - D_AIX43 - D_AIX51 - >> D_AIX52 - D_AIX53 - D_AIX61 - D_ALL_SOURCE - DFUNCPROTO = 15-O -I / opt / >> freeware / include - DNDEBUG -O - c >> -I/usr/lib/instantclient_11_2/sdk/include -I/opt/freeware/include/python2.7 >> cx_Oracle.c it build/temp.aix-6.1-2.7 -11g/cx_Oracle.o = 5.1.2 - >> DBUILD_VERSION >> Unable to run xlc_r : No such file or directory >> error : command ' xlc_r ' failed with exit status 1 > > > How do I change " xlc_e " by " gcc " . > > # oslevel - s > 6100-06-06-1140 > > # lslpp - ch | grep -i xlc > / usr / lib / objrepos : xlC.aix61.rte : 11.1.0.1 :: COMMIT : COMPLETE : > 05/20/11 : 07 , 32, 06 > / usr / lib / objrepos : xlC.cpp : 9.0.0.0 :: COMMIT : COMPLETE : 05/19/11 > : 16 , 27, 09 > / usr / lib / objrepos : xlC.msg.en_US.cpp : 9.0.0.0 :: COMMIT : COMPLETE > : 05/19/11 : 16 , 49, 30 > / usr / lib / objrepos : xlC.msg.en_US.rte : 11.1.0.1 :: COMMIT : COMPLETE > : 05/20/11 : 08 , 02 , 45 > / usr / lib / objrepos : xlC.rte : 11.1.0.1 :: COMMIT : COMPLETE : > 05/20/11 : 08 , 02 , 43 > / usr / lib / objrepos : xlC.sup.aix50.rte : 9.0.0.1 :: COMMIT : COMPLETE > : 05/19/11 : 15 , 45, 49 > > > I use this shell environment when compiling on AIX: > export CC=gcc > export CXX=g++ > export F77=xlf > export FFLAGS="-O -I/opt/freeware/include" > export LD=ld > export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" > export CFLAGS="-maix64 -g -mminimal-toc -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_ALL_SOURCE -DFUNCPROTO=15 -O2 -I/opt/freeware/include" > export CXXFLAGS=$CFLAGS > export OBJECT_MODE=64 > > You should at least set the CC variable to gcc. I use the gcc RPMs distributed from perzl.org to compile. > > -- > [Kristian Berg] > > > > ------------------------------------------------------------------------------ > Shape the Mobile Experience: Free Subscription > Software experts and developers: Be at the forefront of tech innovation. > Intel(R) Software Adrenaline delivers strategic insight and game-changing > conversations that shape the rapidly evolving mobile landscape. Sign up > now. > http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |
From: Kristian B. <kr...@ti...> - 2013-11-25 14:48:39
|
On 25.11.2013 15:18, Ivanelson Nunes wrote: > I want to install cx_Oracle - 5.1.2 on AIX 6 , however I got an error : > >> bash -4.2 $ python setup.py install >> / usr/lib/instantclient_11_2 >> running install >> running build >> running build_ext >> building ' cx_Oracle ' extension >> xlc_r - ma - -I/opt/freeware/include DAIX_GENUINE_CPLUSCPLUS -Wl , - brtl - qmaxmem = 16384 - DSYSV - D_AIX - D_AIX32 - D_AIX41 - D_AIX43 - D_AIX51 - D_AIX52 - D_AIX53 - D_AIX61 - D_ALL_SOURCE - DFUNCPROTO = 15-O -I / opt / freeware / include - DNDEBUG -O - c -I/usr/lib/instantclient_11_2/sdk/include -I/opt/freeware/include/python2.7 cx_Oracle.c it build/temp.aix-6.1-2.7 -11g/cx_Oracle.o = 5.1.2 - DBUILD_VERSION >> Unable to run xlc_r : No such file or directory >> error : command ' xlc_r ' failed with exit status 1 > > How do I change " xlc_e " by " gcc " . > > # oslevel - s > 6100-06-06-1140 > > # lslpp - ch | grep -i xlc > / usr / lib / objrepos : xlC.aix61.rte : 11.1.0.1 :: COMMIT : COMPLETE : 05/20/11 : 07 , 32, 06 > / usr / lib / objrepos : xlC.cpp : 9.0.0.0 :: COMMIT : COMPLETE : 05/19/11 : 16 , 27, 09 > / usr / lib / objrepos : xlC.msg.en_US.cpp : 9.0.0.0 :: COMMIT : COMPLETE : 05/19/11 : 16 , 49, 30 > / usr / lib / objrepos : xlC.msg.en_US.rte : 11.1.0.1 :: COMMIT : COMPLETE : 05/20/11 : 08 , 02 , 45 > / usr / lib / objrepos : xlC.rte : 11.1.0.1 :: COMMIT : COMPLETE : 05/20/11 : 08 , 02 , 43 > / usr / lib / objrepos : xlC.sup.aix50.rte : 9.0.0.1 :: COMMIT : COMPLETE : 05/19/11 : 15 , 45, 49 I use this shell environment when compiling on AIX: export CC=gcc export CXX=g++ export F77=xlf export FFLAGS="-O -I/opt/freeware/include" export LD=ld export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" export CFLAGS="-maix64 -g -mminimal-toc -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_ALL_SOURCE -DFUNCPROTO=15 -O2 -I/opt/freeware/include" export CXXFLAGS=$CFLAGS export OBJECT_MODE=64 You should at least set the CC variable to gcc. I use the gcc RPMs distributed from perzl.org to compile. -- [Kristian Berg] |
From: Ivanelson N. <iva...@gm...> - 2013-11-25 14:18:14
|
I want to install cx_Oracle - 5.1.2 on AIX 6 , however I got an error : bash -4.2 $ python setup.py install > / usr/lib/instantclient_11_2 > running install > running build > running build_ext > building ' cx_Oracle ' extension > xlc_r - ma - -I/opt/freeware/include DAIX_GENUINE_CPLUSCPLUS -Wl , - brtl > - qmaxmem = 16384 - DSYSV - D_AIX - D_AIX32 - D_AIX41 - D_AIX43 - D_AIX51 - > D_AIX52 - D_AIX53 - D_AIX61 - D_ALL_SOURCE - DFUNCPROTO = 15-O -I / opt / > freeware / include - DNDEBUG -O - c > -I/usr/lib/instantclient_11_2/sdk/include -I/opt/freeware/include/python2.7 > cx_Oracle.c it build/temp.aix-6.1-2.7 -11g/cx_Oracle.o = 5.1.2 - > DBUILD_VERSION > Unable to run xlc_r : No such file or directory > error : command ' xlc_r ' failed with exit status 1 How do I change " xlc_e " by " gcc " . # oslevel - s 6100-06-06-1140 # lslpp - ch | grep -i xlc / usr / lib / objrepos : xlC.aix61.rte : 11.1.0.1 :: COMMIT : COMPLETE : 05/20/11 : 07 , 32, 06 / usr / lib / objrepos : xlC.cpp : 9.0.0.0 :: COMMIT : COMPLETE : 05/19/11 : 16 , 27, 09 / usr / lib / objrepos : xlC.msg.en_US.cpp : 9.0.0.0 :: COMMIT : COMPLETE : 05/19/11 : 16 , 49, 30 / usr / lib / objrepos : xlC.msg.en_US.rte : 11.1.0.1 :: COMMIT : COMPLETE : 05/20/11 : 08 , 02 , 45 / usr / lib / objrepos : xlC.rte : 11.1.0.1 :: COMMIT : COMPLETE : 05/20/11 : 08 , 02 , 43 / usr / lib / objrepos : xlC.sup.aix50.rte : 9.0.0.1 :: COMMIT : COMPLETE : 05/19/11 : 15 , 45, 49 @ivanelson []s |
From: Michał N. <mm...@gm...> - 2013-11-06 18:42:54
|
Hello, Please take a look at this simple code: import cx_Oracle as db dsn = '(DESCRIPTION =(CONNECT_TIMEOUT=3)(RETRY_COUNT=1)(TRANSPORT_CONNECT_TIMEOUT=3)(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = SOME_HOST)(PORT = 1531)))(CONNECT_DATA =(SERVICE_NAME = SOME_NAME)))' connect_string = "LOGIN/PASSWORD@%s" % dsn conn = db.connect(connect_string) conn.ping() # WILL HANG FOREVER!!! If `SOME_HOST` is down, this will hang forever! And it's not related to `OCIPing` - if I replace: ping() with: cursor = conn.cursor() cursor.execute('SELECT 1 FROM DUAL') # HANG FOREVER AS WELL This will hang as well. I'm using **SQL*Plus: Release 11.2.0.3.0 Production on Wed Nov 6 12:17:09 2013**. I tried wrapping this code in thread and waiting for same time than killing the thread but this doesn't work. This code creates a thread itself and it's impossible from python to kill it. Do you have any ideas how to recover? Kind regards, Michał Nowotka |
From: Christopher J. <chr...@or...> - 2013-10-16 04:19:19
|
On 10/15/13 2:59 AM, Henning von Bargen wrote: > I just read about the new 'Application Continuity' and 'Transaction > Guard' API for Oracle 12c in the DOAG News (a magazine published by > the German Oracle Users Group). > > This sounds *very* interesting, because as far as I understand, this > is the first time for TAF to really work, since the session package > variables etc should also be restored automatically after a crash. > > Will this work with cx_Oracle? Is anybody here actually using it? > > Henning Transaction Guard would be good to see in cx_Oracle. Application Continuity is currently available through the JDBC "thin" driver but not the OCI C API used by cx_Oracle. There are whitepapers on AC & TG at: http://www.oracle.com/technetwork/products/clustering/ac-overview-1967264.html -- chr...@or... http://twitter.com/ghrd Free PHP & Oracle book: http://www.oracle.com/technetwork/topics/php/underground-php-oracle-manual-098250.html |
From: Henning v. B. <H.v...@t-...> - 2013-10-15 10:26:43
|
I just read about the new “Application Continuity” and “Transaction Guard“ API for Oracle 12c in the DOAG News (a magazine published by the German Oracle Users Group). This sounds *very* interesting, because as far as I understand, this is the first time for TAF to really work, since the session package variables etc should also be restored automatically after a crash. Will this work with cx_Oracle? Is anybody here actually using it? Henning |
From: Mark H. <mh...@pi...> - 2013-10-07 00:20:42
|
anybody seeing something like this? Python seems to build properly. Any clues appreciated! mh@violino ~/ora --> export ORACLE_HOME=/Users/mh/ora/instantclient_11_2 mh@violino ~/ora --> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME mh@violino ~/ora/src/cx_Oracle-5.1.2 --> ../../bin/python setup.py build running build running build_ext building 'cx_Oracle' extension creating build creating build/temp.macosx-10.4-x86_64-2.7-11g /usr/bin/clang -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/mh/ora/instantclient_11_2/sdk/include -I/Users/mh/ora/include/python2.7 -c cx_Oracle.c -o build/temp.macosx-10.4-x86_64-2.7-11g/cx_Oracle.o -DBUILD_VERSION=5.1.2 creating build/lib.macosx-10.4-x86_64-2.7-11g /usr/bin/clang -bundle -undefined dynamic_lookup build/temp.macosx-10.4-x86_64-2.7-11g/cx_Oracle.o -L/Users/mh/ora/instantclient_11_2 -lclntsh -o build/lib.macosx-10.4-x86_64-2.7-11g/cx_Oracle.so -shared-libgcc ld: file not found: crt3.o clang: error: linker command failed with exit code 1 (use -v to see invocation) error: command '/usr/bin/clang' failed with exit status 1 Python seems to be running gcc and not clang(??) mh@violino ~/ora/src/Python-2.7.5 --> make gcc -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE -o Modules/python.o ./Modules/python.c |
From: Michael B. <mi...@zz...> - 2013-08-28 16:33:06
|
On Aug 28, 2013, at 6:19 AM, Amaury Forgeot d'Arc <ama...@gm...> wrote: > > 2013/8/28 Michael Bayer <mi...@zz...> > # z=IN, x=OUT, y=OUT, breaks every time in this case: > # ORA-24369 required callbacks > # not registered for one or more bind handles > # different combinations work/fail somewhat randomly, though deterministically > # for a given combination. > cursor.execute( > "INSERT INTO t1 (y, z) VALUES (1, :z) RETURNING t1.x, t1.y INTO :x, :y", > {"z": 1, "x": x, "y": y}) > > According to documentation, it's even surprising that it works sometimes: > http://docs.oracle.com/cd/B10501_01/appdev.920/a96584/oci05bnd.htm#420693 > """ > Even if the application can be sure that it will only get a single value back in the RETURNING clause, it must still bind in OCI_DATA_AT_EXEC mode and use callbacks > """ > > cx_Oracle has no support at all for this OCI_DATA_AT_EXEC. thanks for your reply. So it seems like it is possible, but OCI requires some extra API calls. Does cx_Oracle have any kind of issue tracker in use? At least the task could be logged as a potential enhancement, and something to point my users towards when their Oracle RETURNING clauses fail. |
From: Amaury F. d'A. <ama...@gm...> - 2013-08-28 10:19:44
|
2013/8/28 Michael Bayer <mi...@zz...> > # z=IN, x=OUT, y=OUT, breaks every time in this case: > # ORA-24369 required callbacks > # not registered for one or more bind handles > # different combinations work/fail somewhat randomly, though > deterministically > # for a given combination. > cursor.execute( > "INSERT INTO t1 (y, z) VALUES (1, :z) RETURNING t1.x, t1.y INTO > :x, :y", > {"z": 1, "x": x, "y": y}) > According to documentation, it's even surprising that it works sometimes: http://docs.oracle.com/cd/B10501_01/appdev.920/a96584/oci05bnd.htm#420693 """ Even if the application can be sure that it will only get a single value back in the RETURNING clause, it must still bind in OCI_DATA_AT_EXEC mode and use callbacks """ cx_Oracle has no support at all for this OCI_DATA_AT_EXEC. -- Amaury Forgeot d'Arc |
From: Michael B. <mi...@zz...> - 2013-08-28 02:29:50
|
Hi all - I've located what is either a bad limitation in OCI or a bug in cx_Oracle. The nature of it is pretty hard to pin down, but I've produced a comprehensive demonstration here. Against cx_Oracle 5.1.2, Python 2 or 3, the last statement will produce "ORA-24369: required callbacks not registered for one or more bind handles" every time. There seems to be something going on when you mix both IN/OUT params as well as multiple datatypes with at least one repeat (and then still not always?), it hoses out. You can see that the previous three run cases make use of the exact same variables and constructs, just not all of them at the same time. If anyone has insight into the nature of this bug that would be appreciated! - mike import cx_Oracle conn = cx_Oracle.connect("scott", "tiger", "xe") cursor = conn.cursor() try: cursor.execute("drop table t1") except cx_Oracle.xbaseError: pass cursor.execute(""" CREATE TABLE t1 ( x VARCHAR2(50), y INTEGER, z INTEGER ) """) x = cursor.var(cx_Oracle.STRING) y = cursor.var(cx_Oracle.NUMBER) z = cursor.var(cx_Oracle.NUMBER) # z=IN, x=OUT, works for i in range(1, 5): cursor.execute( "INSERT INTO t1 (y, z) VALUES (1, :z) RETURNING t1.x INTO :x", {"z": 1, "x": x}) # z=IN, y=OUT, works for i in range(1, 5): cursor.execute( "INSERT INTO t1 (y, z) VALUES (1, :z) RETURNING t1.y INTO :y", {"z": 1, "y": y}) # x=OUT, y=OUT, works for i in range(1, 5): cursor.execute( "INSERT INTO t1 (y, z) VALUES (1, 1) RETURNING t1.x, t1.y INTO :x, :y", {"x": x, "y": y}) # z=IN, x=OUT, y=OUT, breaks every time in this case: # ORA-24369 required callbacks # not registered for one or more bind handles # different combinations work/fail somewhat randomly, though deterministically # for a given combination. cursor.execute( "INSERT INTO t1 (y, z) VALUES (1, :z) RETURNING t1.x, t1.y INTO :x, :y", {"z": 1, "x": x, "y": y}) |
From: Meyer M. <Mat...@ge...> - 2013-07-22 06:15:16
|
Hi Jessica, Have you looked at the explain plan of the query? Did you create any indexes or partitions on the tables? The query itself is slow because (as you said) it's complex and because the data set is large, there is no other answer to this question. Also, you are doing the spatial connection of the 2 tables first and then selecting the records you want. Try it the other way around. First filter out all the records you are interested in and then make the spatial connection. The complex thing is the spatial connection, the less you have to do that, the faster your query. Filtering out records is easy. Kind regards, Matthias Meyer ________________________________ Von: Jessica Clarke [mailto:Jes...@fo...] Gesendet: Montag, 22. Juli 2013 02:38 An: cx-...@li... Betreff: [cx-oracle-users] Slow spatial query execution Hi, I've been banging my head for a week trying to figure out why this query is running so slow. The query is complex and the data set is quite large. Simpler queries also take a long time, but this one in particular takes 11 hours. So I thought if I could figure this one out, I could figure out the formula for the rest. SELECT count(*) from (select b.* from PI.PITYPE b, coupe.base_pc_a c where c.provcoupe = 'coupe1' AND SDO_RELATE(b.shape, SDO_GEOM.SDO_BUFFER(c.shape, -1, 1), 'MASK=ANYINTERACT')='TRUE') a WHERE a.PITYPE like 'ER5%' or a.PITYPE like 'ER6%' or a.PITYPE like 'coER5%' or a.PITYPE like 'coER6%' OR (SUBSTR(a.concisepi,1,1) IN ('A','B','D','G','H') AND SUBSTR(a.concisepi,4,1) in ('1','2','3','6','7') and SUBSTR(a.concisepi,5,1) in ('A','B','C','D')) Thanks, Jess Clarke [cid:RCEKJYWWPKKC.51e01260.jpg]<http://www.facebook.com/forestrytasmania>[cid:YDFEAHZPMCCK.51e01261.jpg]<https://twitter.com/Forestrytasmnia>[cid:ZESQEASPCCDM.FT_YT.jpg]<http://www.youtube.com/user/Forestrytas> Forestry creates regional employment: http://youtu.be/UBIUGiCiX00 Growing tomorrow's high conservation value forests: http://www.youtube.com/watch?v=wP6XCailI-A --------------------------------------------------------------- This transmission is intended solely for the person or organisation to whom it is addressed. It is confidential and may contain legally privileged information. If you have received this transmission in error, you must not keep, forward, copy, use, save or rely on this communication. Any such action is unauthorised and prohibited. Please reply to this email to notify the sender of its incorrect delivery, and then delete both it and your reply. No liability is accepted for any unauthorised use of the information contained in this transmission. Despite our use of anti-virus software, Forestry Tasmania cannot guarantee that this transmission is virus-free. ________________________________ GEHE Informatik Services GmbH & Co. KG, Sitz: Stuttgart, AG Stuttgart, HRA 12167, UST-IdNr. DE 811 655 252 Pers?nlich haftende Gesellschafterin: GEHE Pharma Handel GmbH, Sitz: Stuttgart, AG Stuttgart, HRB 14591, Gesch?ftsf?hrer: Andr? Bl?mel (Vorsitzender), Rainer Baumg?rtner, Dr. Peter Schreiner Weitere Gesellschafter: GEHE Informatik Services-Verwaltungs GmbH, Sitz: Stuttgart, AG Stuttgart, HRB 15843 Gesch?ftsf?hrer: Rainer Baumg?rtner, Dr. Stefan Grill ______________________________________________________________________ This email has been scanned by the Symantec Email Security.cloud service. For more information please visit http://www.symanteccloud.com ______________________________________________________________________ |
From: Jessica C. <Jes...@fo...> - 2013-07-22 00:55:24
|
Hi, I've been banging my head for a week trying to figure out why this query is running so slow. The query is complex and the data set is quite large. Simpler queries also take a long time, but this one in particular takes 11 hours. So I thought if I could figure this one out, I could figure out the formula for the rest. SELECT count(*) from (select b.* from PI.PITYPE b, coupe.base_pc_a c where c.provcoupe = 'coupe1' AND SDO_RELATE(b.shape, SDO_GEOM.SDO_BUFFER(c.shape, -1, 1), 'MASK=ANYINTERACT')='TRUE') a WHERE a.PITYPE like 'ER5%' or a.PITYPE like 'ER6%' or a.PITYPE like 'coER5%' or a.PITYPE like 'coER6%' OR (SUBSTR(a.concisepi,1,1) IN ('A','B','D','G','H') AND SUBSTR(a.concisepi,4,1) in ('1','2','3','6','7') and SUBSTR(a.concisepi,5,1) in ('A','B','C','D')) Thanks, Jess Clarke --------------------------------------------------------------- Forestry creates regional employment: http://youtu.be/UBIUGiCiX00 Growing tomorrow's high conservation value forests: http://www.youtube.com/watch?v=wP6XCailI-A --------------------------------------------------------------- This transmission is intended solely for the person or organisation to whom it is addressed. It is confidential and may contain legally privileged information. If you have received this transmission in error, you must not keep, forward, copy, use, save or rely on this communication. Any such action is unauthorised and prohibited.Please reply to this email to notify the sender of its incorrect delivery, and then delete both it and your reply. No liability is accepted for any unauthorised use of the information contained in this transmission. Despite our use of anti-virus software, Forestry Tasmania cannot guarantee that this transmission is virus-free. |
From: Roger W. <rog...@to...> - 2013-07-09 14:01:24
|
Hi, we have been using cx_Oracle for quite a while and have recently re-compiled with cx_Oracle 5.1.2 and Oracle 11g, and now have a problem with connection.ping() always returning False. Ping is used to check if the connection is OK during error recovery... The gist of the code is this: try: if hasattr(self._connection, "ping"): if self._connection.ping(): return True else: return False else: if not hasattr(self._connection, "cursor"): if not self._getCursor(): return False self._connection.cursor().execute("select now from dual") return True except Exception, e: ... The code finds that the database connection has an attribute ping, but calling it always returns an object that evaluates as False. If I force the routine to use the second method if checking the connection (using SQL) it always works. This code worked OK with a previous version using oracle 10... I have fixed the problem by forcing the code not to use ping, but it would be nice to get to the bottom of this... Is anyone else experiencing this??? Thanks in advance.. Roger |
From: Anthony T. <ant...@gm...> - 2013-07-07 04:21:11
|
Hi, The latest code is on BitBucket. You can find it here: https://bitbucket.org/anthony_tuininga/cx_oracle That *should* be made clearer. :-) Anthony On Sat, Jul 6, 2013 at 5:01 PM, Shai Berger <sh...@pl...> wrote: > Hi all, > > This is my first posting on this list. I've been using cx_Oracle, mostly > through Django, for quite some time now; recently I became a Django > committer, > mostly to help taking care of Django's Oracle backend. > > I'm looking for the current code repository for cx_Oracle. I was able to > find > http://cx-oracle.svn.sourceforge.net/ which has updates as late as 16 > months > ago (version 5.1.1 and a little after), but nothing more updated. > > Note that the project page on SF still has references to CVS (repository > last > updated in 2003); and if you try to follow the link to "code" you get to > http://sourceforge.net/p/cx-oracle/code/368/tree/ which is apparently the > same > repository, but that page for some reason shows all paths in it as if they > were last updated in 2007. > > Anyway, 5.1.2 (latest released version) does not appear to be in this repo, > nor anything done since then. I'm asking because, while working on Django's > oracle backend, I ran into some funny performance characteristics I'd like > to > help improve, and also some not-so-funny segmentation faults with Python 3. > > Thanks, > Shai. > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Shai B. <sh...@pl...> - 2013-07-06 23:01:25
|
Hi all, This is my first posting on this list. I've been using cx_Oracle, mostly through Django, for quite some time now; recently I became a Django committer, mostly to help taking care of Django's Oracle backend. I'm looking for the current code repository for cx_Oracle. I was able to find http://cx-oracle.svn.sourceforge.net/ which has updates as late as 16 months ago (version 5.1.1 and a little after), but nothing more updated. Note that the project page on SF still has references to CVS (repository last updated in 2003); and if you try to follow the link to "code" you get to http://sourceforge.net/p/cx-oracle/code/368/tree/ which is apparently the same repository, but that page for some reason shows all paths in it as if they were last updated in 2007. Anyway, 5.1.2 (latest released version) does not appear to be in this repo, nor anything done since then. I'm asking because, while working on Django's oracle backend, I ran into some funny performance characteristics I'd like to help improve, and also some not-so-funny segmentation faults with Python 3. Thanks, Shai. |
From: Michał N. <mm...@gm...> - 2013-07-06 13:13:37
|
Hi, Has anyone succeeded with running cx_Oracle 5.1.x on pypy? I've submitted following bug: https://bugs.pypy.org/issue1530 and I'm looking for possible solutions. Kind regards, Michał Nowotka |
From: Anthony T. <ant...@gm...> - 2013-06-26 13:17:29
|
Hi, Yes, I would be interested. You can send the information directly to me ( ant...@gm...). Thanks. Anthony On Wed, Jun 26, 2013 at 1:11 AM, Alan Gibson <ala...@gm...> wrote: > Hello all, > > This question is really aimed more at the cx_Oracle developer(s). > > I'm currently building precompiled cx_Oracle wheel packages on Windows for > my own use. I'd like to post these wheels to PyPi to make life a little > easier for unfortunate enough to be running Windows in an Oracle shop like > me. > > A little background: Wheels are a new packaging format supported by the > upcoming pip 1.4. The wheel format is meant to replace (among other things) > the need to supply msi files to install binary distributions on Windows, as > well as allow binaries to be _easily_ installed via pip. > > Would you be interested in collaborating on this? > > Br, Alan > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |
From: Alan G. <ala...@gm...> - 2013-06-26 07:11:59
|
Hello all, This question is really aimed more at the cx_Oracle developer(s). I'm currently building precompiled cx_Oracle wheel packages on Windows for my own use. I'd like to post these wheels to PyPi to make life a little easier for unfortunate enough to be running Windows in an Oracle shop like me. A little background: Wheels are a new packaging format supported by the upcoming pip 1.4. The wheel format is meant to replace (among other things) the need to supply msi files to install binary distributions on Windows, as well as allow binaries to be _easily_ installed via pip. Would you be interested in collaborating on this? Br, Alan |
From: Tamás G. <gt...@gt...> - 2013-06-24 20:04:53
|
> Date: Thu, 30 May 2013 19:01:27 +0200 > From: "Amaury Forgeot d'Arc" <ama...@gm...> > Subject: Re: [cx-oracle-users] How to debug "into" oci? > To: cx-...@li... > Message-ID: > <CAGmFidYURUctub-fafb1KywfmM=z6V...@ma...> > Content-Type: text/plain; charset="iso-8859-1" > > Hi, > > >From your output: >> dataArr: 0xc2000001a8 > This seems to be the address on the stack. > Is the address still valid when OCIStmtExecute runs? > This is important, because this is where the ref cursor will be returned. > > In cx_Oracle, "dataArr" is always an array of one or more objects. > Here the objects are pointers (OCIStmt*), but they still need to be > allocated on the heap. > > -- > Amaury Forgeot d'Arc Thanks Amaury! Of course the problem was with my code: I've written the (temp) cursor handle to dataArr, not the address of it! Although this has nothing to do with allocation, but convinced me to clean up my code, as that has the error. Re-read the available documentation, and the last line of Table 5-1 at http://docs.oracle.com/cd/B12037_01/appdev.101/b10779/oci05bnd.htm#438183 said I need to write the address of the *OCIStmt, and I wrote only *OCIStmt, not **OCIStmt... I've tried, and it works now! Thanks again, Tamás Gulácsi |
From: Northrup, C. T <Car...@bo...> - 2013-06-18 22:54:27
|
//----------------------------------------------------------------------------- // Subscription.c // Defines the routines for handling Oracle subscription information. //----------------------------------------------------------------------------- #include <sys/unistd.h> #include <ifaddrs.h> #include <arpa/inet.h> #include <netinet/in.h> #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> #include <string.h> //----------------------------------------------------------------------------- // structures used for handling subscriptions //----------------------------------------------------------------------------- typedef struct { PyObject_HEAD OCISubscription *handle; udt_Connection *connection; PyObject *callback; ub4 namespace; ub4 protocol; ub4 port; ub4 timeout; ub4 operations; ub4 rowids; } udt_Subscription; typedef struct { PyObject_HEAD ub4 type; PyObject *dbname; PyObject *tables; } udt_Message; typedef struct { PyObject_HEAD PyObject *name; PyObject *rows; ub4 operation; } udt_MessageTable; typedef struct { PyObject_HEAD PyObject *rowid; ub4 operation; } udt_MessageRow; static char* getIpAddr(); //----------------------------------------------------------------------------- // Declaration of subscription functions //----------------------------------------------------------------------------- static void Subscription_Free(udt_Subscription*); static PyObject *Subscription_Repr(udt_Subscription*); static PyObject *Subscription_RegisterQuery(udt_Subscription*, PyObject*); static void Message_Free(udt_Message*); static void MessageTable_Free(udt_MessageTable*); static void MessageRow_Free(udt_MessageRow*); //----------------------------------------------------------------------------- // declaration of members for Python types //----------------------------------------------------------------------------- static PyMemberDef g_SubscriptionTypeMembers[] = { { "callback", T_OBJECT, offsetof(udt_Subscription, callback), READONLY }, { "connection", T_OBJECT, offsetof(udt_Subscription, connection), READONLY }, { "namespace", T_INT, offsetof(udt_Subscription, namespace), READONLY }, { "protocol", T_INT, offsetof(udt_Subscription, protocol), READONLY }, { "port", T_INT, offsetof(udt_Subscription, port), READONLY }, { "timeout", T_INT, offsetof(udt_Subscription, timeout), READONLY }, { "operations", T_INT, offsetof(udt_Subscription, operations), READONLY }, { "rowids", T_BOOL, offsetof(udt_Subscription, rowids), READONLY }, { NULL } }; static PyMemberDef g_MessageTypeMembers[] = { { "type", T_INT, offsetof(udt_Message, type), READONLY }, { "dbname", T_OBJECT, offsetof(udt_Message, dbname), READONLY }, { "tables", T_OBJECT, offsetof(udt_Message, tables), READONLY }, { NULL } }; static PyMemberDef g_MessageTableTypeMembers[] = { { "name", T_OBJECT, offsetof(udt_MessageTable, name), READONLY }, { "rows", T_OBJECT, offsetof(udt_MessageTable, rows), READONLY }, { "operation", T_INT, offsetof(udt_MessageTable, operation), READONLY }, { NULL } }; static PyMemberDef g_MessageRowTypeMembers[] = { { "rowid", T_OBJECT, offsetof(udt_MessageRow, rowid), READONLY }, { "operation", T_INT, offsetof(udt_MessageRow, operation), READONLY }, { NULL } }; //----------------------------------------------------------------------------- // declaration of methods for Python types //----------------------------------------------------------------------------- static PyMethodDef g_SubscriptionTypeMethods[] = { { "registerquery", (PyCFunction) Subscription_RegisterQuery, METH_VARARGS }, { NULL, NULL } }; //----------------------------------------------------------------------------- // Python type declarations //----------------------------------------------------------------------------- static PyTypeObject g_SubscriptionType = { PyVarObject_HEAD_INIT(NULL, 0) "cx_Oracle.Subscription", // tp_name sizeof(udt_Subscription), // tp_basicsize 0, // tp_itemsize (destructor) Subscription_Free, // tp_dealloc 0, // tp_print 0, // tp_getattr 0, // tp_setattr 0, // tp_compare (reprfunc) Subscription_Repr, // tp_repr 0, // tp_as_number 0, // tp_as_sequence 0, // tp_as_mapping 0, // tp_hash 0, // tp_call 0, // tp_str 0, // tp_getattro 0, // tp_setattro 0, // tp_as_buffer Py_TPFLAGS_DEFAULT, // tp_flags 0, // tp_doc 0, // tp_traverse 0, // tp_clear 0, // tp_richcompare 0, // tp_weaklistoffset 0, // tp_iter 0, // tp_iternext g_SubscriptionTypeMethods, // tp_methods g_SubscriptionTypeMembers, // tp_members 0, // tp_getset 0, // tp_base 0, // tp_dict 0, // tp_descr_get 0, // tp_descr_set 0, // tp_dictoffset 0, // tp_init 0, // tp_alloc 0, // tp_new 0, // tp_free 0, // tp_is_gc 0 // tp_bases }; static PyTypeObject g_MessageType = { PyVarObject_HEAD_INIT(NULL, 0) "cx_Oracle.Message", // tp_name sizeof(udt_Message), // tp_basicsize 0, // tp_itemsize (destructor) Message_Free, // tp_dealloc 0, // tp_print 0, // tp_getattr 0, // tp_setattr 0, // tp_compare 0, // tp_repr 0, // tp_as_number 0, // tp_as_sequence 0, // tp_as_mapping 0, // tp_hash 0, // tp_call 0, // tp_str 0, // tp_getattro 0, // tp_setattro 0, // tp_as_buffer Py_TPFLAGS_DEFAULT, // tp_flags 0, // tp_doc 0, // tp_traverse 0, // tp_clear 0, // tp_richcompare 0, // tp_weaklistoffset 0, // tp_iter 0, // tp_iternext 0, // tp_methods g_MessageTypeMembers, // tp_members 0, // tp_getset 0, // tp_base 0, // tp_dict 0, // tp_descr_get 0, // tp_descr_set 0, // tp_dictoffset 0, // tp_init 0, // tp_alloc 0, // tp_new 0, // tp_free 0, // tp_is_gc 0 // tp_bases }; static PyTypeObject g_MessageTableType = { PyVarObject_HEAD_INIT(NULL, 0) "cx_Oracle.MessageTable", // tp_name sizeof(udt_MessageTable), // tp_basicsize 0, // tp_itemsize (destructor) MessageTable_Free, // tp_dealloc 0, // tp_print 0, // tp_getattr 0, // tp_setattr 0, // tp_compare 0, // tp_repr 0, // tp_as_number 0, // tp_as_sequence 0, // tp_as_mapping 0, // tp_hash 0, // tp_call 0, // tp_str 0, // tp_getattro 0, // tp_setattro 0, // tp_as_buffer Py_TPFLAGS_DEFAULT, // tp_flags 0, // tp_doc 0, // tp_traverse 0, // tp_clear 0, // tp_richcompare 0, // tp_weaklistoffset 0, // tp_iter 0, // tp_iternext 0, // tp_methods g_MessageTableTypeMembers, // tp_members 0, // tp_getset 0, // tp_base 0, // tp_dict 0, // tp_descr_get 0, // tp_descr_set 0, // tp_dictoffset 0, // tp_init 0, // tp_alloc 0, // tp_new 0, // tp_free 0, // tp_is_gc 0 // tp_bases }; static PyTypeObject g_MessageRowType = { PyVarObject_HEAD_INIT(NULL, 0) "cx_Oracle.MessageRow", // tp_name sizeof(udt_MessageRow), // tp_basicsize 0, // tp_itemsize (destructor) MessageRow_Free, // tp_dealloc 0, // tp_print 0, // tp_getattr 0, // tp_setattr 0, // tp_compare 0, // tp_repr 0, // tp_as_number 0, // tp_as_sequence 0, // tp_as_mapping 0, // tp_hash 0, // tp_call 0, // tp_str 0, // tp_getattro 0, // tp_setattro 0, // tp_as_buffer Py_TPFLAGS_DEFAULT, // tp_flags 0, // tp_doc 0, // tp_traverse 0, // tp_clear 0, // tp_richcompare 0, // tp_weaklistoffset 0, // tp_iter 0, // tp_iternext 0, // tp_methods g_MessageRowTypeMembers, // tp_members 0, // tp_getset 0, // tp_base 0, // tp_dict 0, // tp_descr_get 0, // tp_descr_set 0, // tp_dictoffset 0, // tp_init 0, // tp_alloc 0, // tp_new 0, // tp_free 0, // tp_is_gc 0 // tp_bases }; //----------------------------------------------------------------------------- // MessageRow_Initialize() // Initialize a new message row with the information from the descriptor. //----------------------------------------------------------------------------- static int MessageRow_Initialize( udt_MessageRow *self, // object to initialize udt_Environment *env, // environment to use dvoid *descriptor) // descriptor to get information from { ub4 rowidLength; sword status; char *rowid; // determine operation status = OCIAttrGet(descriptor, OCI_DTYPE_ROW_CHDES, &self->operation, NULL, OCI_ATTR_CHDES_ROW_OPFLAGS, env->errorHandle); if (Environment_CheckForError(env, status, "MessageRow_Initialize(): get operation") < 0) return -1; // determine table name status = OCIAttrGet(descriptor, OCI_DTYPE_ROW_CHDES, &rowid, &rowidLength, OCI_ATTR_CHDES_ROW_ROWID, env->errorHandle); if (Environment_CheckForError(env, status, "MessageRow_Initialize(): get rowid") < 0) return -1; self->rowid = cxString_FromEncodedString(rowid, rowidLength, env->encoding); if (!self->rowid) return -1; return 0; } //----------------------------------------------------------------------------- // MessageTable_Initialize() // Initialize a new message table with the information from the descriptor. //----------------------------------------------------------------------------- static int MessageTable_Initialize( udt_MessageTable *self, // object to initialize udt_Environment *env, // environment to use dvoid *descriptor) // descriptor to get information from { dvoid **rowDescriptor, *indicator; ub4 nameLength, i; udt_MessageRow *row; boolean exists; OCIColl *rows; sword status; sb4 numRows; char *name; // determine operation status = OCIAttrGet(descriptor, OCI_DTYPE_TABLE_CHDES, &self->operation, NULL, OCI_ATTR_CHDES_TABLE_OPFLAGS, env->errorHandle); if (Environment_CheckForError(env, status, "MessageTable_Initialize(): get operation") < 0) return -1; // determine table name status = OCIAttrGet(descriptor, OCI_DTYPE_TABLE_CHDES, &name, &nameLength, OCI_ATTR_CHDES_TABLE_NAME, env->errorHandle); if (Environment_CheckForError(env, status, "MessageTable_Initialize(): get table name") < 0) return -1; self->name = cxString_FromEncodedString(name, nameLength, env->encoding); if (!self->name) return -1; // if change invalidated all rows, nothing to do if (self->operation & OCI_OPCODE_ALLROWS) return 0; // determine rows collection status = OCIAttrGet(descriptor, OCI_DTYPE_TABLE_CHDES, &rows, NULL, OCI_ATTR_CHDES_TABLE_ROW_CHANGES, env->errorHandle); if (Environment_CheckForError(env, status, "MessageTable_Initialize(): get rows collection") < 0) return -1; // determine number of rows in collection status = OCICollSize(env->handle, env->errorHandle, rows, &numRows); if (Environment_CheckForError(env, status, "MessageTable_Initialize(): get size of rows collection") < 0) return -1; // populate the rows attribute self->rows = PyList_New(numRows); if (!self->rows) return -1; for (i = 0; i < numRows; i++) { status = OCICollGetElem(env->handle, env->errorHandle, rows, i, &exists, (dvoid*) &rowDescriptor, &indicator); if (Environment_CheckForError(env, status, "MessageTable_Initialize(): get element from collection") < 0) return -1; row = (udt_MessageRow*) g_MessageRowType.tp_alloc(&g_MessageRowType, 0); if (!row) return -1; PyList_SET_ITEM(self->rows, i, (PyObject*) row); if (MessageRow_Initialize(row, env, *rowDescriptor) < 0) return -1; } return 0; } //----------------------------------------------------------------------------- // Message_Initialize() // Initialize a new message with the information from the descriptor. //----------------------------------------------------------------------------- static int Message_Initialize( udt_Message *self, // object to initialize udt_Environment *env, // environment to use dvoid *descriptor) // descriptor to get information from { dvoid **tableDescriptor, *indicator; udt_MessageTable *table; ub4 dbnameLength, i; OCIColl *tables; boolean exists; sb4 numTables; char *dbname; sword status; // determine type status = OCIAttrGet(descriptor, OCI_DTYPE_CHDES, &self->type, NULL, OCI_ATTR_CHDES_NFYTYPE, env->errorHandle); if (Environment_CheckForError(env, status, "Message_Initialize(): get type") < 0) return -1; // determine database name status = OCIAttrGet(descriptor, OCI_DTYPE_CHDES, &dbname, &dbnameLength, OCI_ATTR_CHDES_DBNAME, env->errorHandle); if (Environment_CheckForError(env, status, "Message_Initialize(): get database name") < 0) return -1; self->dbname = cxString_FromEncodedString(dbname, dbnameLength, env->encoding); if (!self->dbname) return -1; // determine table collection status = OCIAttrGet(descriptor, OCI_DTYPE_CHDES, &tables, NULL, OCI_ATTR_CHDES_TABLE_CHANGES, env->errorHandle); if (Environment_CheckForError(env, status, "Message_Initialize(): get tables collection") < 0) return -1; // determine number of tables if (!tables) numTables = 0; else { status = OCICollSize(env->handle, env->errorHandle, tables, &numTables); if (Environment_CheckForError(env, status, "Message_Initialize(): get size of collection") < 0) return -1; } // create list to hold results self->tables = PyList_New(numTables); if (!self->tables) return -1; // populate each entry with a message table instance for (i = 0; i < numTables; i++) { status = OCICollGetElem(env->handle, env->errorHandle, tables, i, &exists, (dvoid*) &tableDescriptor, &indicator); if (Environment_CheckForError(env, status, "Message_Initialize(): get element from collection") < 0) return -1; table = (udt_MessageTable*) g_MessageTableType.tp_alloc(&g_MessageTableType, 0); if (!table) return -1; PyList_SET_ITEM(self->tables, i, (PyObject*) table); if (MessageTable_Initialize(table, env, *tableDescriptor) < 0) return -1; } return 0; } //----------------------------------------------------------------------------- // Subscription_CallbackHandler() // Routine that performs the actual call. //----------------------------------------------------------------------------- static int Subscription_CallbackHandler( udt_Subscription *self, // subscription object udt_Environment *env, // environment to use dvoid *descriptor) // descriptor to get information from { PyObject *result, *args; udt_Message *message; // create the message message = (udt_Message*) g_MessageType.tp_alloc(&g_MessageType, 0); if (!message) return -1; if (Message_Initialize(message, env, descriptor) < 0) { Py_DECREF(message); return -1; } // create the arguments for the call args = PyTuple_Pack(1, message); Py_DECREF(message); if (!args) return -1; // make the actual call result = PyObject_Call(self->callback, args, NULL); Py_DECREF(args); if (!result) return -1; Py_DECREF(result); return 0; } //----------------------------------------------------------------------------- // Subscription_Callback() // Routine that is called when a callback needs to be invoked. //----------------------------------------------------------------------------- static void Subscription_Callback( udt_Subscription *self, // subscription object OCISubscription *handle, // subscription handle dvoid *payload, // payload ub4 *payloadLength, // payload length dvoid *descriptor, // descriptor ub4 mode) // mode used { #ifdef WITH_THREAD PyGILState_STATE gstate = PyGILState_Ensure(); #endif udt_Environment *env; // perform the call env = Environment_NewFromScratch(0, 0, NULL, NULL); if (!env) PyErr_Print(); else { if (Subscription_CallbackHandler(self, env, descriptor) < 0) PyErr_Print(); Py_DECREF(env); } // restore thread state, if necessary #ifdef WITH_THREAD PyGILState_Release(gstate); #endif } //----------------------------------------------------------------------------- // Subscription_Register() // Register the subscription. //----------------------------------------------------------------------------- static int Subscription_Register( udt_Subscription *self) // subscription to register { udt_Environment *env; sword status; // create the subscription handle env = self->connection->environment; status = OCIHandleAlloc(env->handle, (dvoid**) &self->handle, OCI_HTYPE_SUBSCRIPTION, 0, 0); if (Environment_CheckForError(env, status, "Subscription_Register(): allocate handle") < 0) return -1; // set the namespace status = OCIAttrSet(self->handle, OCI_HTYPE_SUBSCRIPTION, (dvoid*) &self->namespace, sizeof(ub4), OCI_ATTR_SUBSCR_NAMESPACE, env->errorHandle); if (Environment_CheckForError(env, status, "Subscription_Register(): set namespace") < 0) return -1; // set the protocol status = OCIAttrSet(self->handle, OCI_HTYPE_SUBSCRIPTION, (dvoid*) &self->protocol, sizeof(ub4), OCI_ATTR_SUBSCR_RECPTPROTO, env->errorHandle); if (Environment_CheckForError(env, status, "Subscription_Register(): set protocol") < 0) return -1; // set the timeout status = OCIAttrSet(self->handle, OCI_HTYPE_SUBSCRIPTION, (dvoid*) &self->timeout, sizeof(ub4), OCI_ATTR_SUBSCR_TIMEOUT, env->errorHandle); if (Environment_CheckForError(env, status, "Subscription_Register(): set timeout") < 0) return -1; // set the IP address char* ip_addr = getIpAddr(); // "134.51.168.81"; printf("using ip : %s\n", ip_addr); status = OCIAttrSet(env->handle, OCI_HTYPE_ENV, (dvoid *) ip_addr, (ub4) strlen(ip_addr), OCI_ATTR_SUBSCR_IPADDR, env->errorHandle); if (Environment_CheckForError(env, status, "Subscription_Register(): set ipaddr") < 0) return -1; // set the TCP port used on client to listen for callback from DB server if (self->port > 0) { status = OCIAttrSet(env->handle, OCI_HTYPE_ENV, (dvoid*) &(self->port), (ub4) 0, OCI_ATTR_SUBSCR_PORTNO, env->errorHandle); if (Environment_CheckForError(env, status, "Subscription_Register(): set port") < 0) return -1; } // set the context for the callback status = OCIAttrSet(self->handle, OCI_HTYPE_SUBSCRIPTION, (dvoid*) self, 0, OCI_ATTR_SUBSCR_CTX, env->errorHandle); if (Environment_CheckForError(env, status, "Subscription_Register(): set context") < 0) return -1; // set the callback, if applicable if (self->callback) { status = OCIAttrSet(self->handle, OCI_HTYPE_SUBSCRIPTION, (dvoid*) Subscription_Callback, 0, OCI_ATTR_SUBSCR_CALLBACK, env->errorHandle); if (Environment_CheckForError(env, status, "Subscription_Register(): set callback") < 0) return -1; } // set whether or not rowids are desired status = OCIAttrSet(self->handle, OCI_HTYPE_SUBSCRIPTION, (dvoid*) &self->rowids, sizeof(ub4), OCI_ATTR_CHNF_ROWIDS, env->errorHandle); if (Environment_CheckForError(env, status, "Subscription_Register(): set rowids") < 0) return -1; // set which operations are desired status = OCIAttrSet(self->handle, OCI_HTYPE_SUBSCRIPTION, (dvoid*) &self->operations, sizeof(ub4), OCI_ATTR_CHNF_OPERATIONS, env->errorHandle); if (Environment_CheckForError(env, status, "Subscription_Register(): set operations") < 0) return -1; // register the subscription Py_BEGIN_ALLOW_THREADS status = OCISubscriptionRegister(self->connection->handle, &self->handle, 1, env->errorHandle, OCI_DEFAULT); Py_END_ALLOW_THREADS if (Environment_CheckForError(env, status, "Subscription_Register(): register") < 0) return -1; return 0; } //----------------------------------------------------------------------------- // Subscription_New() // Allocate a new subscription object. //----------------------------------------------------------------------------- static udt_Subscription *Subscription_New( udt_Connection *connection, // connection object ub4 namespace, // namespace to use ub4 protocol, // protocol to use ub4 port, // client port for callbacks PyObject *callback, // callback routine ub4 timeout, // timeout (in seconds) ub4 operations, // operations to notify int rowids) // retrieve rowids? { udt_Subscription *self; self = (udt_Subscription*) g_SubscriptionType.tp_alloc(&g_SubscriptionType, 0); if (!self) return NULL; Py_INCREF(connection); self->connection = connection; Py_XINCREF(callback); self->callback = callback; self->namespace = namespace; self->protocol = protocol; self->port = port; self->timeout = timeout; self->rowids = rowids; self->operations = operations; self->handle = NULL; if (Subscription_Register(self) < 0) { Py_DECREF(self); return NULL; } return self; } //----------------------------------------------------------------------------- // Subscription_Free() // Free the memory associated with a subscription. //----------------------------------------------------------------------------- static void Subscription_Free( udt_Subscription *self) // subscription to free { if (self->handle) OCISubscriptionUnRegister(self->connection->handle, self->handle, self->connection->environment->errorHandle, OCI_DEFAULT); Py_CLEAR(self->connection); Py_CLEAR(self->callback); Py_TYPE(self)->tp_free((PyObject*) self); } //----------------------------------------------------------------------------- // Subscription_Repr() // Return a string representation of the subscription. //----------------------------------------------------------------------------- static PyObject *Subscription_Repr( udt_Subscription *subscription) // subscription to repr { PyObject *connectionRepr, *module, *name, *result, *format, *formatArgs; format = cxString_FromAscii("<%s.%s on %s>"); if (!format) return NULL; connectionRepr = PyObject_Repr((PyObject*) subscription->connection); if (!connectionRepr) { Py_DECREF(format); return NULL; } if (GetModuleAndName(Py_TYPE(subscription), &module, &name) < 0) { Py_DECREF(format); Py_DECREF(connectionRepr); return NULL; } formatArgs = PyTuple_Pack(3, module, name, connectionRepr); Py_DECREF(module); Py_DECREF(name); Py_DECREF(connectionRepr); if (!formatArgs) { Py_DECREF(format); return NULL; } result = cxString_Format(format, formatArgs); Py_DECREF(format); Py_DECREF(formatArgs); return result; } //----------------------------------------------------------------------------- // Subscription_RegisterQuery() // Register a query for database change notification. //----------------------------------------------------------------------------- static PyObject *Subscription_RegisterQuery( udt_Subscription *self, // subscription to use PyObject *args) // arguments { PyObject *statement, *executeArgs; udt_Buffer statementBuffer; udt_Environment *env; udt_Cursor *cursor; sword status; // parse arguments executeArgs = NULL; if (!PyArg_ParseTuple(args, "O!|O", cxString_Type, &statement, &executeArgs)) return NULL; if (executeArgs) { if (!PyDict_Check(executeArgs) && !PySequence_Check(executeArgs)) { PyErr_SetString(PyExc_TypeError, "expecting a dictionary or sequence"); return NULL; } } // create cursor to perform query env = self->connection->environment; cursor = (udt_Cursor*) Connection_NewCursor(self->connection, NULL); if (!cursor) return NULL; // allocate the handle so the subscription handle can be set if (Cursor_AllocateHandle(cursor) < 0) { Py_DECREF(cursor); return NULL; } // prepare the statement for execution if (cxBuffer_FromObject(&statementBuffer, statement, env->encoding) < 0) { Py_DECREF(cursor); return NULL; } status = OCIStmtPrepare(cursor->handle, env->errorHandle, (text*) statementBuffer.ptr, statementBuffer.size, OCI_NTV_SYNTAX, OCI_DEFAULT); cxBuffer_Clear(&statementBuffer); if (Environment_CheckForError(env, status, "Subscription_RegisterQuery(): prepare statement") < 0) { Py_DECREF(cursor); return NULL; } // perform binds if (executeArgs && Cursor_SetBindVariables(cursor, executeArgs, 1, 0, 0) < 0) { Py_DECREF(cursor); return NULL; } if (Cursor_PerformBind(cursor) < 0) { Py_DECREF(cursor); return NULL; } // parse the query in order to get the defined variables Py_BEGIN_ALLOW_THREADS status = OCIStmtExecute(self->connection->handle, cursor->handle, env->errorHandle, 0, 0, 0, 0, OCI_DESCRIBE_ONLY); Py_END_ALLOW_THREADS if (Environment_CheckForError(env, status, "Subscription_RegisterQuery(): parse statement") < 0) { Py_DECREF(cursor); return NULL; } // perform define as needed if (Cursor_PerformDefine(cursor) < 0) { Py_DECREF(cursor); return NULL; } // set the subscription handle status = OCIAttrSet(cursor->handle, OCI_HTYPE_STMT, self->handle, 0, OCI_ATTR_CHNF_REGHANDLE, env->errorHandle); if (Environment_CheckForError(env, status, "Subscription_RegisterQuery(): set subscription handle") < 0) { Py_DECREF(cursor); return NULL; } // execute the query which registers it if (Cursor_InternalExecute(cursor, 0) < 0) { Py_DECREF(cursor); return NULL; } Py_DECREF(cursor); Py_INCREF(Py_None); return Py_None; } //----------------------------------------------------------------------------- // Message_Free() // Free the memory associated with a message. //----------------------------------------------------------------------------- static void Message_Free( udt_Message *self) // object to free { Py_CLEAR(self->dbname); Py_CLEAR(self->tables); Py_TYPE(self)->tp_free((PyObject*) self); } //----------------------------------------------------------------------------- // MessageTable_Free() // Free the memory associated with a table in a message. //----------------------------------------------------------------------------- static void MessageTable_Free( udt_MessageTable *self) // object to free { Py_CLEAR(self->name); Py_TYPE(self)->tp_free((PyObject*) self); } //----------------------------------------------------------------------------- // MessageRow_Free() // Free the memory associated with a row in a message. //----------------------------------------------------------------------------- static void MessageRow_Free( udt_MessageRow *self) // object to free { Py_CLEAR(self->rowid); Py_TYPE(self)->tp_free((PyObject*) self); } //----------------------------------------------------------------------------- // getIpAddr() // Gets the IP address of eth0 to use with subscription registration //----------------------------------------------------------------------------- static char* getIpAddr() { char* ipaddr = "127.0.0.1"; //"134.51.168.81"; struct ifaddrs * ifAddrStruct=NULL; struct ifaddrs * ifa=NULL; void * tmpAddrPtr=NULL; getifaddrs(&ifAddrStruct); for (ifa = ifAddrStruct; ifa != NULL; ifa = ifa->ifa_next) { if (ifa ->ifa_addr->sa_family==AF_INET) { // check it is IP4 // is a valid IP4 Address tmpAddrPtr=&((struct sockaddr_in *)ifa->ifa_addr)->sin_addr; char addressBuffer[INET_ADDRSTRLEN]; inet_ntop(AF_INET, tmpAddrPtr, addressBuffer, INET_ADDRSTRLEN); //printf("%s IP Address %s\n", ifa->ifa_name, addressBuffer); //use the eth0 interface if(strncmp(ifa->ifa_name, "eth0", 50) == 0) { ipaddr = addressBuffer; //printf("returning '%s'\n", ipaddr); return ipaddr; } } /* add back to support IP_V6 else if (ifa->ifa_addr->sa_family==AF_INET6) { // check it is IP6 // is a valid IP6 Address tmpAddrPtr=&((struct sockaddr_in6 *)ifa->ifa_addr)->sin6_addr; char addressBuffer[INET6_ADDRSTRLEN]; inet_ntop(AF_INET6, tmpAddrPtr, addressBuffer, INET6_ADDRSTRLEN); printf("%s IP Address %s\n", ifa->ifa_name, addressBuffer); } */ } return ipaddr; } |
From: Walter D. <wa...@li...> - 2013-06-13 09:55:04
|
Hello all! Would it make sense to extend the list of error codes that result in an OperationalError by the following list: 28 # your session has been killed 1014 # Oracle shutdown in progress 1035 # Oracle only available to users with RESTRICTED SESSION privilege 3106 # fatal two-task communication protocol error 12154 # TNS:could not resolve the connect identifier specified 12540 # TNS:internal limit restriction exceeded 12541 # TNS:no listener 12543 # TNS:destination host unreachable Servus, Walter |