How to cancel my query in an occi program? [message #138241] |
Tue, 20 September 2005 20:27 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
firestorm
Messages: 3 Registered: May 2005 Location: china
|
Junior Member |
|
|
as the query:
1: ResultSet *rs = stmt->executeQuery();
......
2: while(rs->next (array_fetch_size))
......
For step 1 and step 2, In my application, it will be a long time, maybe 10 min, to finish the occi calls. I had tried to terminate the Environment in anohter thread when time out, and surely I meet error. Then I tried to cancel the thread, also not a good idea.
Does anybody know the way to cancel a query or set a timeout parameter in occi call?
I need you help, thank you
|
|
|
|
|
|
Linking Problem :- OCCI/C++/linux(Redhat) please Help [message #150966 is a reply to message #138489] |
Mon, 12 December 2005 05:57 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
manav.sah
Messages: 15 Registered: September 2005 Location: India
|
Junior Member |
![manav_3](/forum/theme/orafaq/images/yahoo.png)
|
|
hi! i m new in OCI/OCCI...
i m trying to compilea simple occi/c++ program in redhat linux 9 with oracle 9i.
i m compiling the program as
g++ ./occi1.cc -I/opt/ora9/product/9.2/rdbms/demo/ -I/opt/ora9/product/9.2/rdbms/public/ -c
and linking as :-
g++ ./occi1.o /opt/ora9/product/9.2/lib/libocci9.a /opt/ora9/product/9.2/lib/libclntsh.so
[./occi1.o(.gnu.linkonce.t._ZN7occidmlC1ESsSsSs+0x20): In function `occidml::occidml[in-charge](std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
: undefined reference to `oracle::occi::Environment::createEnvironment(oracle::occi::Environment::Mode, void*, void* (*)(void*, unsigned), void* (*)(void*, void*, unsigned), void (*)(void*, void*))'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `cerr'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `__pure_virtual'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `exception type_info function'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `__cp_push_exception'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `endl(ostream &)'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `__uncatch_exception'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `__out_of_range(char const *)'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `__rtti_user'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `__ctype_toupper'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `__rtti_si'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `__check_eh_spec'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `__throw'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `ostream::operator<<(char const *)'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `terminate(void)'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `__start_cp_handler'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `__cp_pop_exception'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `exception type_info node'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `__builtin_vec_new'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `__eh_rtime_match'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `__length_error(char const *)'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `__builtin_vec_delete'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `exception virtual table'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `__rtti_class'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `__builtin_delete'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `__builtin_new'
/opt/ora9/product/9.2/lib/libocci.so: undefined reference to `__eh_alloc'
collect2: ld returned 1 exit status
pls help me to get over these error...
and guide me how to link the occi program...
is there any other file needed..
thanks
Best Regards
Manav Sah
|
|
|
Re: How to cancel my query in an occi program? [message #214502 is a reply to message #138489] |
Tue, 16 January 2007 15:56 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
ifer
Messages: 1 Registered: January 2007
|
Junior Member |
|
|
I attempt you method in a class with OCCI:
1. get handle in connection procedure with:
ptrOCIServer = cnn->getOCIServer();
2. in the query procedure:
pthread_create( &m_threadTimeout, NULL, cancelQuery, this );
myStatement->executeUpdate();
3. into a thread:
void * cancelQuery( void * args ) {
MyObject * ptrMyObject = (MyObject*)args;
OCIError * ptrOCIError;
int intResult = OCIBreak((OCIServer *)ptrMyObject->ptrOCIServer, ptrOCIError);
....
but show the "Segementation fault" exception message. Where the error?
|
|
|