Abort of a OCILobRead() (streaming mode) after one execution - URGENT

Hi All,
I want to fetch 14bytes from a CLOB and then abort OCILobRead. My code is like below.
While executing, it is fetching 1 to 138th piece and then giving me the output ORA-01013: user requested cancel of current operation
But I want to this to come just after getting 1st piece.
while (retval == OCI_NEED_DATA) {
checkerr(errhp, retval = OCILobRead(svchp, errhp, lobl, &amtp, offset, (dvoid *) bufp,nbytes, (dvoid *)0,
(sb4 (*)(dvoid *, CONST dvoid *, ub4, ub1)) 0,
(ub2) 0, (ub1) SQLCS_IMPLICIT));
offset += amtp;
// break after getting 1st piece
if (++counter == 1) {
checkerr(errhp, OCIBreak(svchp, errhp));
Thanks,
Manoj

Hi All,
I want to fetch 14bytes from a CLOB and then abort OCILobRead. My code is like below.
While executing, it is fetching 1 to 138th piece and then giving me the output ORA-01013: user requested cancel of current operation
But I want to this to come just after getting 1st piece.
while (retval == OCI_NEED_DATA) {
checkerr(errhp, retval = OCILobRead(svchp, errhp, lobl, &amtp, offset, (dvoid *) bufp,nbytes, (dvoid *)0,
(sb4 (*)(dvoid *, CONST dvoid *, ub4, ub1)) 0,
(ub2) 0, (ub1) SQLCS_IMPLICIT));
offset += amtp;
// break after getting 1st piece
if (++counter == 1) {
checkerr(errhp, OCIBreak(svchp, errhp));
Thanks,
Manoj

Similar Messages

  • Abort of a OCILobRead() (streaming mode)

    I have a problem on canceling a sequence of OCILobRead() calls. They are in streaming mode, setting the amtp parameter to 0, and calling it over and over again as long as OCILobRead() returns OCI_NEED_DATA.
    According to the documentation, a sequence of those calls can be aborted with OCIBreak(), but this does not work in my case. The OCIBreak call returns without error, but the next OCI operation on that connection fails with:
    ORA-03127 no new operations allowed until the active operation ends.
    I tried it in both blocking mode and nonblocking mode, but the resulting error is the same.
    Any help would be appreciated.

    I tried that, but it doesn't work too. I dont get the mentioned error ORA-01013, but the additional OCILobRead returns again OCI_NEED_DATA.
    It seems that the OCIBreak had no influence at all on the sequence of calls.
    I extracted the code to a small test program, maybe i missed something during initialization (mode???), or statement prep?
    #include <string.h>
    #include <stdlib.h>
    #include <stdio.h>
    #include <oci.h>
    static OCIEnv*     oci_env     = NULL;  // Environment handle
    static OCISvcCtx*  oci_svcctx  = NULL;  // Service handle
    static OCIServer*  oci_server  = NULL;  // Server handles
    static OCIError*   oci_error   = NULL;  // Error handle
    static OCISession* oci_session = NULL;  // Session handle
    static OCIStmt*    oci_stmt    = NULL;  // Statement handle
    void checkerr(sword status)
      switch (status)
        case OCI_SUCCESS:
          break;
        case OCI_SUCCESS_WITH_INFO:
          printf("Info - OCI_SUCCESS_WITH_INFO\n");
          break;
        case OCI_NEED_DATA:
          printf("Info - OCI_NEED_DATA\n");
          break;
        case OCI_NO_DATA:
          printf("Info - OCI_NODATA\n");
          break;
        case OCI_ERROR:
          text  errbuf[1024];
          sb4   errcode = 0;
          OCIErrorGet(oci_error, 1, NULL, &errcode, errbuf, sizeof(errbuf), OCI_HTYPE_ERROR);
          printf("Error - %s\n", errbuf);
          break;
        case OCI_INVALID_HANDLE:
          printf("Error - OCI_INVALID_HANDLE\n");
          break;
        case OCI_STILL_EXECUTING:
          printf("Info - OCI_STILL_EXECUTE\n");
          break;
        case OCI_CONTINUE:
          printf("Error - OCI_CONTINUE\n");
          break;
        default:
          break;
    void logon(char* user, char* pass, char* host)
      // allocate environment handle
      checkerr(OCIEnvCreate(&oci_env, OCI_DEFAULT, NULL, NULL, NULL, NULL, 0, NULL));
      // allocate error handle
      checkerr(OCIHandleAlloc(oci_env, (dvoid**)&oci_error, OCI_HTYPE_ERROR, 0, NULL));
      // allocate server handle
      checkerr(OCIHandleAlloc(oci_env, (dvoid**)&oci_server, OCI_HTYPE_SERVER, 0, NULL));
      // allocate service context
      checkerr(OCIHandleAlloc(oci_env, (dvoid**)&oci_svcctx, OCI_HTYPE_SVCCTX, 0, NULL));
      checkerr(OCIServerAttach(oci_server, oci_error, (text*)host, strlen(host), 0));
      // set attribute server context in the service context
      checkerr(OCIAttrSet(oci_svcctx, OCI_HTYPE_SVCCTX, oci_server, 0, OCI_ATTR_SERVER, oci_error));
      // allocate session handle
      checkerr(OCIHandleAlloc(oci_env, (dvoid**)&oci_session, OCI_HTYPE_SESSION, 0, NULL));
      // set attributes username and password in the session context
      checkerr(OCIAttrSet(oci_session, OCI_HTYPE_SESSION, user, strlen(user), OCI_ATTR_USERNAME, oci_error));
      checkerr(OCIAttrSet(oci_session, OCI_HTYPE_SESSION, pass, strlen(pass), OCI_ATTR_PASSWORD, oci_error));
      // begin session
      checkerr(OCISessionBegin(oci_svcctx, oci_error, oci_session, OCI_CRED_RDBMS, OCI_DEFAULT));
      checkerr(OCIAttrSet(oci_svcctx, OCI_HTYPE_SVCCTX, oci_session, 0, OCI_ATTR_SESSION, oci_error));
    void logoff()
      checkerr(OCISessionEnd(oci_svcctx, oci_error, oci_session, OCI_DEFAULT));
      checkerr(OCIServerDetach(oci_server, oci_error, OCI_DEFAULT));
      /* free handles */
      if (oci_session)
        OCIHandleFree(oci_session, OCI_HTYPE_SESSION);
      if (oci_svcctx)
        OCIHandleFree(oci_svcctx, OCI_HTYPE_SVCCTX);
      if (oci_server)
        OCIHandleFree(oci_server, OCI_HTYPE_SERVER);
      if (oci_error)
        OCIHandleFree(oci_error, OCI_HTYPE_ERROR);
      if (oci_stmt)
        OCIHandleFree(oci_stmt, OCI_HTYPE_STMT);
      if (oci_env)
        OCIHandleFree(oci_env, OCI_HTYPE_ENV);
    int checkout()
      text*          select = (text*) "SELECT blob_obj FROM te_rblock WHERE te_rblock.obj_id = '301000xxx:1:1'";
      OCIDefine*     oci_define;
      OCILobLocator* oci_lob;
      ub2            oci_ind, oci_rlen, oci_rcode;
      checkerr(OCIHandleAlloc(oci_env, (dvoid**)&oci_stmt, OCI_HTYPE_STMT, 0, NULL));
      checkerr(OCIStmtPrepare(oci_stmt, oci_error, select, strlen((char*)select), (ub4)OCI_NTV_SYNTAX, (ub4)OCI_DEFAULT));
      checkerr(OCIDescriptorAlloc(oci_env, (void**)&oci_lob, OCI_DTYPE_LOB, 0, NULL));
      checkerr(OCIDefineByPos(oci_stmt, &oci_define, oci_error, 1, &oci_lob, 0, SQLT_BLOB, &oci_ind, &oci_rlen, &oci_rcode, OCI_DEFAULT));
      checkerr(OCIStmtExecute(oci_svcctx, oci_stmt, oci_error, 1, 0, NULL, NULL, OCI_DEFAULT));
      ub4       offset = 1;
      ub4       amount = 0;
      const ub4 PIECE_SIZE = 128;
      ub4       piece_len = PIECE_SIZE;
      char      piece[PIECE_SIZE + 1];
      int       counter = 0;
      sword     ret = OCI_NEED_DATA;
      while (ret == OCI_NEED_DATA)
        checkerr(ret = OCILobRead(oci_svcctx, oci_error, oci_lob, &amount, offset, piece, piece_len, NULL, NULL, 0, SQLCS_IMPLICIT));
        // if we dont interrupt it, everything is ok
        if (++counter == 5)
          checkerr(OCIBreak(oci_svcctx, oci_error));
          break;
      checkerr(OCIHandleFree(oci_stmt, OCI_HTYPE_STMT));
      oci_stmt = NULL;
      return 0;
    int main(int argc,char* argv[])
      if (argc != 4)
        printf("usage: %s <dbuser> <pwd> <db>\n", argv[0]);
        return -1;
      logon(argv[1], argv[2], argv[3]);
      // first checkout works fine
      checkout();
      // second time ORA-03127 occurs!!
      checkout();
      logoff();
      return 0;

  • PRODUCTION ORDER--Qty changed after one operation----URGENT

    Dear Experts
            Hope u all R doing well
    In the production order,after one operation completed(whether it is first ,second  or last ) the system is allowing to change the qty.
    but we want the system to disallow  the qty change.
    could anybody can help, is there any configuration settings inside?
    waiting for your valuable response
    Thanks in advance

    Hi,
    Sorry for the delay.
    Pl. follow the steps below.
    1. Create a status profile Eg: s1 usng t.code bs02.
    2. Enter status no. as 1, status as CRTD, a description, tick Initial status & lower status no. as 1 & higher status no. as 2.
    3.In the second line enter status no. as 2, status as REL, a description,  & lower status no. as 1 & higher status no. as 3.
    4.Choose Object type tab.
    5. Choose PP/PM: Order header.(tick)
    6.Then come back to main screen & double click REL.
    7.Click the create icon in the top.
    8.Choose Release & then choose radio button under <b>SET.</b>
    9.Then come back to main screen & again double click REL & then choose create & select change & check the radio button under <b>FORBID</b> & then save.
    10. In t.code OPJH(order type), choose your order type & then assign the status profile( Eg:S1)
    11.Now convert the planned order into production order.Release the order & save.
    Further changes cannot be made in the production order.
    Pl. give feedback after testing.
    Regards,
    S.D.Senthilkumar

  • Apple tv 3 after OS 5.1 update stalls streaming movies after one movie

    I updated our Apple tv 3 to os 5.1 (on 29 Sep 2012). The update worked without a hitch, except that after playing a single movie using home sharing the apple tv now stalls on the pin wheel loading the second movie. The only thing that seems to fix this is restarting the computer serving the movies. Restarting itunes doesn't work, neither does restarting the apple tv. This problem didn't occur prior to updating the apple tv.
    Our machine serving the apple tv is a little old (ibook g4 with itunes 10.6.3) but hasn't changed between updates. The only thing that changed between the update is the apple tv software.
    Has anyone come across this problem? Is there a way to go back to version 5.0.2? This is causing some frustration.

    Hi All,
    I tried two fixes which worked for this problem
    1) do away with wifi completely. This worked really well, as I was originally using an ibook g4 which wasn't much use to me for much else. Connected everything up and never had a problem with ATV3 running 5.1.1
    2) downgrade to 5.0.2. Following the instructions here (http://forum.firecore.com/topic/8989). make sure you get the correct restore file for an ATV3 if you're using it. This link has a copy to both restore files (http://forum.gsmhosting.com/vbb/archive/t-1486275.html).
    Neither are elegant solutions, but the downgrade seems to be working best - considering I can now operate it all with wifi again.

  • A connection was abortively closed after one of the peers sent an rst packet

    Hello,
    i have a dvr on netwoek that is wok fine. i tried to publish it over internet.
    i have tmg with two wan connections(load Balancing) and two internal networks.
    i create a server application rule and and but dvr protcols on it.
    when i try to open it from outside it's not working. on tmg log it's give me this error:
     A connection was closed because no SYN/ACK reply was received from the server.
    also with others dvr i get this error:
    a connection was abortively closed after one of the peers sent an rst packet
    i tired to read all post on forums but i didn't get a solution for it.
    please not that the network rule from internal to external is route and the publish rule is set to make the request is from local host.
    so whats the problem?
    thanks.

    Hi,
    Thank you for your post here.
    As far as i know, if you would like to publish server located in internal, you need to set the relationship between internal and external as NAT.
    Best Regards
    Quan Gu

  • I try to insert some images on a website but the images are not in the right color mode. I do not know what to do? and also I have 1200 images to insert so I can not change one after one. So I need to set up an action, but I donot know how to do it... Tha

    I try to insert some images on a website but the images are not in the right color mode. I do not know what to do? and also I have 1200 images to insert so I can not change one after one. So I need to set up an action, but I donot know how to do it... Thanks

    What is the problem specifiaclly?
    If the images are intended for web use I would recommend converting them to sRGB which could be done with Edit > Convert to Profile or with File > Save for Web, but as including a Save step in Actions and applying them as Batch can sometimes cause problems I would go with regular converting.
    You could also try Image Processor Pro.
    Scripts Page

  • Macbook with osx 10.6.8 crashes after installing itunes 10.6 when viewing in the album mode(middle one)?

    Macbook with osx 10.6.8 crashes in the album mode(middle one) after installing itunes 10.6? It still crashes if I open itunes in the sfe mode.

    iTUNES 10.6.1.7
    How do I restore the original iTUNES that recognizes our music libraries and our iPODS?
    Thanks for your consideration.
    Message was edited by: mrtruffles

  • Stop during viewing of HD-movie in stream mode

    Ladies and gentlemen,
    I had problems with Apple TV
    Chart of my connecting:
    *Apple TV <–> AirPort Extreme (802.11n ( n-only )) <–> iMac 24 (C2D) <–> external HDD WD MyBook 750 gb (FW800)* .
    I convert a HD-movie from the .mkv ( +KLCP Matroska File , Video: MPEG4, (H264) 1280x544, 23.98fps, Audio: Dolby AC3 48000Hz stereo, filesize 4,5 gb+ )
    I convert a movie in Visualhub. In the parameters of this program specify that a format on an output must correspond the format of Apple TV. I get a Mp4-file
    I plug Apple TV in the ”Streaming” mode, аnd begin to look a movie. Some time all shows fine, but in 10-15 minutes play is stopped (a picture is frozen, sound is stopped), after press pause/play, I can again continue viewing, but after a while problem will repeat again.
    I noticed that precipices were halted 50% film, and stops take a place only at the active stages of film (moving car, explosions, or any other quickly-moving objects)
    I will be beholden for elucidations of my question.
    With kind regards
    Message was edited by: megadzilla

    Actually that isn't what I suggested.
    I suggested you convert from matroska to DV and then from from DV to .m4v
    If there is an error in your conversion from matroska to h364 with visualhub that error won't disappear by reconverting it.
    If you don't wish to try what I suggested, open one of the files you are having trouble with in QT, open the inspector window and tell us what it says, I suspect it will seem OK but we can have a look and see.
    Of course your problem could be a slow network, but if you don't wish to diagnose your problem it likely won't get solved.

  • My iphone 5 is stuck in recovery mode after battery change?

    my iphone 5 is stuck in recovery mode after battery change, I decided to change my faulty iphone 5 battery as i was out of warrenty, I managed to chance the battery with no problems (I Think), when i put the phone back together and tried to power on with the power button, nothing happened.!  i connected to itunes and it powered on, displaying the connect to itunes screen (recovery mode) all was going well, the phone was restoring, the image of the phone restoring and loading up was displayed on the screen, when it finished it restarted but to show the connect to itunes screen again, it is stuck in the recovery loop. i tried the steps with holding the power and home button etc, none worked.! now when i try to restore, it extracts software but then, ' the iphone could not be restored, an unknown error occured (3194)' comes up, any ideas out there???? and Happy Christmas to Everyone ,

    Hello Andyoneill9,
    It sounds like you are trying to restore your phone but keep getting an errror message 3194. I want to recommend the troubleshooting steps from this article named:
    Error 3194 or "This device isn't eligible for the requested build"
    http://support.apple.com/kb/ts4451
    Resolution
    Important: If you see one of these messages and need help updating or restoring your iOS device, Install the latest version of iTunes and try to update or restore again. After that, follow these steps if you need more help.
    Check your "hosts" file
    After you've updated iTunes to the latest version, you can check the hosts file to be sure your computer can contact the update server. Use the numbered steps below if you’re on a Mac.
    If you’re using a Windows computer, follow steps in this Microsoft support article, noting that resetting the hosts file will affect software services that rely on hosts file redirects. If you're using Windows on a business computer, consult your IT department to be sure applications will still work correctly after resetting the hosts file.
    In the Finder, choose Applications > Utilities.
    Open Terminal.
    Enter this command and then press Return:
    sudo nano /private/etc/hosts
    Enter the password you use to sign in to your computer and press Return. You won't see text appear in the Terminal window when you enter the password. Make sure you use a nonblank administrator password.
    Terminal will display the hosts file. Navigate using the arrow keys and look for an entry containing “gs.apple.com”.
    Add the # symbol and a space ("# ") to the beginning of the gs.apple.com entry.
    Press Control-O to save the file. Then, press Enter when prompted for the filename and Control-X to exit the editor.
    Restart your computer.
    Try to update or restore your iOS device again.
    This is the first troublehsooting step to try, so there are additional things to try if needed you need them.
    Thank you for using Apple Support Communities.
    Regards,
    Sterling

  • My ipod 4 is stuck in recovery mode after trying to update to 8.0.2

    I started to download the new update this morning when it said i did not have enough memory for it, so i deleted a few things and re tried and this time it worked. However once it was done downloading it said i needed to install it, which when i pressed for it to install then said i did not have enough memory to install, so once again i deleted a few things and pressed for it to install again but this caused my iPod to go into recovery mode. when i plugged it into my computer and started up iTunes it said i needed to restore my iPod, having a back up already i did not really care so i selected for it to restore and update however all that happens is the loading bar that says connecting to iPod update server which after a few seconds closes and at the same time my iPod disconnects from iTunes. i have tried multiple times to update and restore it but the same thing keeps happening.  has this anyone got a fix?

    Try the following. Jump to DFU mode.                                               
    - iOS: Not responding or does not turn on           
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try another cable              
    - Try on another computer                                                       
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar                                     
    Also maybe:
    Update Server
    Try:
    - Powering off and then back on your router.
    - iTunes for Windows: iTunes cannot contact the iPhone, iPad, or iPod software update server
    - Change the DNS to either Google's or Open DNS servers
    Public DNS — Google Developers
    OpenDNS IP Addresses
    - For one user uninstalling/reinstalling iTunes resolved the problem
    - Try on another computer/network
    - Wait if it is an Apple problem

  • HT201317 how do I take old photos in my album on my ipad and have them go in my photo stream to see on my iphone.  It's only streaming the new ones I take..

    I want to take my older photos in my Ipad and have them streaming to my iphone and computer..  As of now it's only streaming the new ones I take.. Is there an easy way to put the other ones on my photo Icloud stream so I can view them from all of my devices?

    That's by design; photo stream only uploads photos taken after turning on photo stream, not earlier photos.  Adding earlier photos to photo stream can be done in a couple of different ways:
    Open the photos one at a time and take a screenshot.  This will add a new low resolution copy of the photo to the camera roll, which will then upload to your photo stream;
    Email the photos a few at a time to yourself, then save the attached photos to your camera roll.  This will add a copy of the photo at full resolution to your camera roll and upload to photo stream;
    Use an app like PhotoSync, which will allow you to wirelessly transfer copies of all your old photos to your computer all at once.  Then delete these photos from your camera roll and use PhotoSync to transfer them back from your computer to your camera roll.  These will be the original resolution and will upload to your photo stream.  (You need an app like this because iTunes will not transfer photos back to your camera roll, where they must be in order to add to your photo stream.)

  • My iPod is stuck in recovery mode after failing to update to iOS 8.whatever and now won't connect to iTunes to restore?

    So yeah, got an iPod touch for Christmas and it's pretty much bricked it and I haven't even had it for a full month yet. Not amused. I've tried everything from reinstalling everything Apple related on my laptop to external programs that promise to kick that thing out of recovery mode. If there's any other way to fix it I'd love to know considering it won't show up in iTunes at all so there's no way for me to restore it. This is my first Apple product and I haven't found a solution to a problem that I've found dates back as far as 2012 with no semblance of a way to fix it. Though I've seen ways to fix each problem separately it appears you need one thing to be working to fix the other which is an issue.
    Okay I'm just ranting to but help would be appreciated

    Try:                                               
    - iOS: Not responding or does not turn on           
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try another cable                     
    - Try on another computer                                                       
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
      Apple Retail Store - Genius Bar                              

  • My iPod is stuck in Recovery Mode after trying to Update...

    I was trying to update my ipod 4th gen (ios 6.1.3 or something like that) and it went into Recovery Mode.
    My laptop have Windows XP on it and doesn't allow me to plug anything into the USB thingys. I've tried everything to get them to work, but it won't work.
    I have also tried to do a hard reset on my ipod, and also tried holding down the home & power button until the apple icon pops up then hold one home button for 5 secs or whatever and it won't work.
    What should I do?
    I might give my ipod to a friend and see if her laptop will let me restore it. But it won't be for awhile. /:
    HELLPPPPPPPPP

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar       

  • How to enable chunked streaming mode using OSB config file

    Hi All,
    Is there way through which we can enable and disable the chunked streaming mode option in Business service (of OSB) through OSB configuration file?? If yes, please let me know.
    Thanks,
    Aditya

    Hi Aditya,
    I don't think it can be done dynamically the way you described... But I believe you can create two business services, one with chunked=on and the other with chunked=off and route to one of them dynamically according to your configuration...
    Cheers,
    Vlad

  • C60 BOOT UP IN MAIN MODE AFTER SOFTWARE UPGRADE

    Any one aware of why the C60 would go into maintenance mode after software upgrade from TC5.0.1 to TC7.2.1???
    Software loaded and appears to install properly ???
    Thanks.

    Hi Chet,
    You can try a factory reset in addition to the suggestions in the following post for similar issue
    https://supportforums.cisco.com/discussion/12394476/c60-possibly-faulty
    HTH
    Manish

Maybe you are looking for

  • How can I reset an old iphone?

    I bought a new iPhone 5s, after iCloud all the data to the new phone, I want reset the old iphone 3s to my kid. How can I do reset that not interfere my other devises?

  • Why is Firefox writing so much data all the time?

    I am running Windows 7 x64 and Firefox 8. In my Task Manager I display the I/O Write Bytes of all processes. I have found that Firefox is ALWAYS the Process with the largest amount of write bytes after it has been running an hour or so even though th

  • The iPhone cannot be synced, needs later version of iTunes.

    I have an iPhone 4 with iOS5 beta 3. I also have the latest MacBook Pro 13in with i5 processor. My mac has OS X Lion GM. Today I downloaded iOS beta 3 and restored my iPhone. After the restore was made iTunes could not sync my iPhone becasue supposed

  • Search feature missing from Acrobat reader?

    I loaded a PDF file out to my Touchpad but there does not appear to be any search feature in the Acrobat reader?   Am I doing something wrong?  Post relates to: HP TouchPad (WiFi)

  • Count the number of segments used in payload.

    Hi experts, We have a received payload like : Seg1 - header seg2 - item seg2 - item seg2 - item seg3 - footer In the seg3 footer filed1 should have the value of number of segments used in payload, for example in above payload the value of field1 shou