How do I cancel an operation in Pro*C (with threads)

I would like to be able to cancel a potentially long running Oracle operation initiated in Pro*C. It seems that, in an application having only a single database connection (i.e. does not use EXEC SQL ENABLE THREADS), I can do this by sending the SIGINT signal from another thread -- since obviously the DB thread is blocked waiting for the operation to complete. By having the "cancel thread" execute a pthread_kill(tid, SIGINT) against the blocked thread the operation is cancelled and the requisite Oracle error (ORA-01013) is caught.
However, it seems that once I enable threads, this method stops working. Unfortunately, the application I am writing needs multiple database threads. More dismal, I need to direct the cancellation to a single thread. I can, of course, direct the SIGINT to a thread via pthread_kill, but it does not work. Even a single thread with a single DB connection ignores the attempt to cancel -- in fact the program I wrote to test my initial theory stopped working (well, stopped canceling the operation) immediately just by adding an EXEC SQL ENABLE THREADS call.
So...does anyone know a call that I can make, from within another thread, that would cause an operation (executing on a given database context (sql_context) to become cancelled? Or does anyone have any other suggestions that I may experiment with?
Thanks all! Looking forward to any ideas.
OS: AIX 5.3
DB: Oracle 10g

Well, while I am still unsure why enabling threads renders my original solution incapable, I have found a suitable working solution.
After some research, I came across the OCIBreak call in the Oracle Call Interface. Mating this with the Pro*C functions to get the environment and service contexts (SQLEnvGet and SQLSvcCtxGet) allows me to call it. So, currently I set a SIGALRM signal handler and use pthread_kill in the monitoring thread to fire it off. The signal handler eventually calls OCIBreak.
I am hoping I can get rid of the signal handler and directly call OCIBreak from within the the monitoring thread itself -- but I'm not sure if this will break Oracle's thread consistency model and cause any heart ache. Oracle says that only a single thread should execute commands on a context, so I am not sure if OCIBreak is an exception to that rule. I may just try it and see what happens, but just because it works does not mean it is right or even stable. I'd like definitive proof (or disproof), so if anyone has some insight that'd be welcome.
Thanks again.
Edited by: DreamWarrior1337 on Jan 22, 2009 2:53 PM

Similar Messages

  • الترجمة I have a problem how can I cancel all operations evaluated by so I can use the service again in the same payment method because Apple stuck processes evaluated by on my account and I can not purchase again

    الترجمة
    I have a problem how can I cancel all operations evaluated by so I can use the service again in the same payment method because Apple stuck processes evaluated by on my account and I can not purchase again

    If your CC was banned for fraudulent activity, you will need to use another CC. If the account was disabled, try changing the password to enable it at : https://appleid.apple.com
    Otherwise, try contacting the iTunes store via : https://expresslane.apple.com , choosing iTunes and then iTunes store and from there selecting the topic as it pertains to your query.

  • How do i cancel my adobe premier pro cc plan

    i've been using this software for almost 1 week and i feel that video editing is a boring job for me. So i would like to cancel my plan but i have no idea how. please help

    ... in addition:
    and https://helpx.adobe.com/x-productkb/global/phone-support-orders.html >>>  see screenshot (screen build-up takes it's time at the moment)
    and international phone support at https://helpx.adobe.com/adobe-connect/adobe-connect-phone-numbers.html
    Hans-Günter

  • How do I cancel my acrobat x pro subscription?

    I need to unsubscribe because doing card charges, so what i have to do???? help me please!

    Hey,
    You might need to navigate to this link and follow instructions on how to cancel your plan:
    Cancel your membership or subscription | Creative Cloud
    Regards,
    Anubha

  • How do I cancel my Final Cut Pro Free Trial?

    I downloaded the 30 Day free trial for Final Cut Pro because I needed to work on a video project. However, I was able to figure something else out and realize now that I don't need FCP. Now I would like to end it before it times out and asks me to buy it. Does anyone have any ideas?

    Welcome to Apple Communities
    Open Finder, select Applications and delete it

  • TS3276 How do I cancel an operation in iCloud mail once it has begun?

    I have sent an email in icloud mail with too large an attachment. As a result in Account info under quota limits, "[icloud] is calculating sizes" and has been doing so for several hours. Nothing, including restarting my iMac can stop the little circle revolving against icloud in my iMac inbox. Accordingly i am not receiving emails into this inbox but emails seem to be reaching my iphone icloud inbox.

    Thanks. I can send emails using iCloud but not receive them on my iMac.
    The only activity is "fetching new mail" from iCloud where the blue/white stripe indicator is moving but this has bee the same for some time.
    There are no unsent messages in my outbox but I cannot delete the message with the overlarge attachment from the recovered message folder - when I do it reappears.

  • How do I completely (!) uninstall "Logic Pro X" with all associated files?

    Hey guys,
    I'm a relatively new MAC user.
    I'm sitting here since two hours to figure out how I can uninstall "Logic Pro X" and all it's associated files completly?
    I found several guides on the internet pointing to different folders which should be deleted.
    When I follow those guides all I get are circa four deleted files and 1 GB of free space nothing more.
    They are all written for older versions of Logic (mostly 8 and 9)!
    So maybe someone here on the official support communities can help me getting rid of it?

    Hi
    If you really want to delete all of it:
    Applications: Logic Pro X
    Macintosh HD:Lbrary:Audio:Apple Loops:Apple (you may want to keep the GarageBand ones?)
    Macintosh HD:Lbrary:Audio:Impulse Responses
    Macintosh HD:Lbrary:Application Support:Logic
    That should get most/all of it
    CCT

  • How do I sync my mac book pro calendar with my iphone 4s

    Does anyone know how to sync my Mac Book Pro with my iphone 4s?  TY!

    Depending your OS, you can do it through iCloud, through iTunes 'info' tab when your device is connected. You can do it through an email account if that's what calendar is set up to use.

  • My iphone crashed and lost all data. how do i upgrade the operating system then sync with itunes?

    My iphone 3g crashed. My calendar and contacts don't appear on itunes.  how do i sync with itunes? should I upgrade operating system first? how to do that?

    "My calendar and contacts don't appear on itunes.  "
    Your calendar ond contacts should be on your computer in whatever program you have selected to sync.
    "how do i sync with itunes? "
    You sync as you always have.
    "should I upgrade operating system first? "
    If you like.
    "how to do that?"
    Open itunes, cconnect iphone.  Itunes should tell you if there is an update avilable or you can click Check for Updates.

  • How to install bootcamp partition on macbook pro 12 with mountain lion

    macbook pro 13" mid 2010 model with mountain lion.  bootcamp assistant with not let me partition.

    Then your drive is to full or has errors of some type. Those are the only reasons for boot camp to stop you from partitioning and installing Windows.

  • How to downgrade to WXP on Satellite Pro A200GE with Toshiba XP Recovery

    Hi I have A200GE having preinstalled windows vista business edition and I ordered it with windows xp and an xp recovery dvd came as its of 3.01GB.
    I really cannot understand that why it cannot install as when i install a blue screen comes in the end and laptop restarts.
    Than i came to know the nlite software and the sata drivers I loaded the sata drivers on another dvd disk separetly as nlite did not recognize my dvd window cd.
    But still I loaded the files separetly, now when I loaded that dvd the setup does not start rather a dos command type window opens and I dont know what to do.
    Plz anybody help me what canI do of the xp recovery cd which came with my laptop as I am desperate to use it vista is too slow and i cannot tolerate it.
    RGRDS
    ZAVI

    Thanks alot for your reply.
    Yes i ordered my laptop with Xp cd which in fact is dvd as its 3.01 GB and yes it is specially made for my notebook ie Satellite Pro A200GE-1F9.
    I purchased my laptop from sharptext in ireland.
    The problem is that when XP setup is copmpleted and when it restarts a blue screen appears and the laptop restarts coz it does not have the intel matrix storage driver.
    Thats funny a cd which is made for my laptop does not work. Furthermore I asked the representative from whome i bought the laptop; he asked from toshiba sales person the person said xp should not be installed coz if the laptop has any kind of hardware failure they wont claim it.
    Secondly I am running the Bios of XP on my Vista currently and now also i have tried but of no avail.
    Further i have copied the Sata drivers on another disc and copied all the data on recovery cd and made it bootable. Then the setup does not start as command window is opened.
    Really doono what to do ohhhh God.
    I think the last thing i can do is that buy a new XP cd from microsoft because a p1 with windows 95 is faster than with Vista.
    Honestly, what do u say.
    Any further help will be appreciated

  • How to change profile picture on macbook pro 13" with retina

    i tried to change my profile picture through "my photo stream" but it keeps saying "take a photo with your iOS device or manually add photos from iPhoto or aperture" i don't what to do HELPPP !! I'm new to macbook btw

    Where are you trying to change your profile picture?
    How can I change my profile picture to a photo from iPhoto?

  • How many install disc does the Mac Pro come with? Snow leopard is preinstalled.

    I have an application install disc that has ilife and a few others but I'm thinking that I may have disc for the system and optional installs somewhere.
    I bought the mac pro tower in march of 2010.
    I cant remember what came with it.
    I thought I would ask before I start digging around in my messy office!

    Two Disks: Install Disk & an Applications Disk. You can call AppleCare, if you lost yours, and for a small fee they will send you one.

  • My mac os is not compatible to support premiere pro. How do I cancel my subscription?

    How do I cancel subscription to premiere pro as it is not compatible with my Mac OS so I cannot download it.

    Cloud Forum http://forums.adobe.com/community/creative_cloud
    Cloud FAQ http://forums.adobe.com/community/download_install_setup/creative_cloud_faq
    http://helpx.adobe.com/x-productkb/policy-pricing/cancel-membership-subscription.html

  • How to stop/cancel Process Chain in BI 7.0

    Hi,
    Could you tell me how to stop/cancel a process chain that hangs with status yellow or green in BI 7.0? There was an easy option to do it in 3.x, but I cannot find a similar option in 7.0.
    What happens is that at random our process chains hang at a certain variant with either yellow or even green status and do not proceed further. What happens is that in a couple of hours another pchain run occurs and it executes fine. Then again at random (might be the same day or the next day) the process chain hangs again. I think that all those "hanged" pchains pile up in the queue, so that it cause other future pchains to hang as well at some point. So, is there anyway to stop/cancel these zombie process chains when it stops at a particular event RSPROCESS in BI 7?
    Thank you,
    AG
    Message was edited by:
            AG

    Hi Frank,
    Thanks for your reply. I have a few questions.
    1)SM37 -->Kill Job
    We cannot do that because the job has already finished.
    2)SM50/sm66- ->Kill process
    There are no hanged processes to kill
    3)RSPC>Job Log>Make the process RED forecefully
    How do you do that exactly?
    4)RSPC>Process chain> main Menu"Remove from Scheduling"  OR
    5)se37-->RSPC_API_CHAIN_INTERRUPT
    give RFC BW system name(technical) and process chain name(technical) - we can do this,  but what exactly would it accomplish. Would it remove the process chain from any runs in the future or also any hanged ones in the past? An how is this step different from #4?
    Thank you,
    AG

Maybe you are looking for

  • Level color not working

    When I select text in an email and click reply, I get a new message that is supposed to set the text one level out and color it blue. It sets the level, but does not color the text. How can I fix this to work properly?

  • Yet another malfunctioning iSight...

    I have already read a few dozen forum topics on several sites, so here is where I am with my MacBook Pro's built-in iSight: - worked fine about 3-4 weeks ago - noticed that PhotoBooth / iChat / Account System Preferences produced a black screen and t

  • I've got a monitor that freezes while the canvas plays.  Suggestions?

    No cracks please about editing indoors... Not sure what's causing this. Have read through earlier posts. Still nothing, so here goes... I'm running FCP 5.0.4 on the G5, now at 10.4.4. and just recently I've started to have my external monitor freeze

  • Loading InfoCube 0PUR_C03

    Hi, when taking infocube 0PUR_C03 from Business Content it creates update rules for datasource 2LIS_02_S015. Datasource gives no data when testing on RSA3. Is there any customizing i should do to get data ? thanks in advance JP

  • How to batch processing and renaming of jpg's

    Hello, I am sort of new with PS CS5 Extended and I am trying to automate a bunch of JPG files by saving them as High Quality into another folder then add the following suffix _hr.jpg. Can this be possible ? Scenario: Source Folder: Original Original