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;

Similar Messages

  • 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

  • Moving purchases done on an ATV in streaming mode to my PC

    I have chosen to use my ATV in streaming mode as I had many issues in Sync mode. Would appreciate some hints on the following challenge:
    I have purchased movies using my ATV. These purchased movies are not showing up in iTunes on my PC. How do I move these across to my PC in order to ensure I have a backup and be able to transfer them to my iPod Touch?

    you need to have sync mode turned on for items to auto-sync back to itunes from appletv.
    turn it on, but then choose "custom sync". this will allow items to sync back to itunes, but will keep the 100% stream that you require.
    this is how mine is set up.

  • No tone in Streaming Mode

    Hello, i have 2 Apple TV Boxes wich are connected by WLan over a Linksys WLan Router to the Network.
    My Steaming Device is a Mac Mini with OSX 10.5.5 the Apple TV Boxes have Firmware 2.2.
    In the streaming Mode (Movies in iTunes (Version 8.01) on the Mac Mini can be played on the MacMini without problems) i can see the Movie but i can't get any tone on the Apple TV Boxes.
    Also if i want to play the movie on the Mac Mini and want to stream only the tone to the Apple TV Boxes i get no tone there too. Can sombody help me ?????

    Hy with no tone i mean no Audio signal. I can see the Movie but without any audio signal.
    The Audio Streaming (Music streaming) works i can play my i Tunes Audio Mediafiles with audio Signal and i can playback them also from iTunes in the Multi Speaker Mode but when i play Movies or stream Movies i get no audio signal. ?????????

  • 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

  • Instance Label in Stream Mode and Different Preference with Same Portlet

    Hi Guys,
    I encounter some problems need your help,
    1. When I use Stream mode, and add a portet, but there is no way to changed instance label, if it's possible to change instance label in Stream mode
    2. I have one portal, and there are some instances of one portlet inside, I just want to set preference to every instance, so portlet can do different work, how to do it?
    Thanks,
    Jing

    When I did the second last production upgrade I used the import facility. Breadcrumbs and templates did not link up to the pages correctly. It took me quite awhile to fix all the problems that were found.
    When I used the import facility for the last production upgrade I kept primary key violations on varying wwv.Flow tables. I used the same process that I had always used to do upgrades. I got in contact with the company that is paid to give us support on Oracle issues.
    They said that the problem was that the size of the sql file created from the export was causing the problem, that it had gone over the HTMLDB 2 limits of 64K.
    We then used the flows_020000 account to upgrade the production application. That fixed all the problems that I was experiencing.
    So to install at the new district with the situation as described in the original question I need to change the application number. That is why I thought of changing the application number if the sql export file.
    This is causing me a fair few headaches so any help and ideas are really appreciated.

  • SQL Exception not in streaming mode

    Hi friends
    I am using oracle driver and I am getting this error on queries very randomly.I am using Oracle8i 8.1.5 on NT machine.
    SQL Exception not in streaming mode
    Can anybody explaing why and when this error gets generated and what is the solution for it.
    Please contact me at the following emailids
    [email protected]
    [email protected]
    null

    What do you do with the connection before the prepareStatement()? Is your program small enough to post here (use [code]...[/code] tags)? Do you have multiple threads that try to use the same connection simultaneously? Do you work with Long, Clob or Blob columns? What JDBC driver version?

  • Struts / Page Flow - forwards to home page in streaming mode

    I have a pretty complex page flow with several actions and several forwards. The
    page flow is using struts validation (using the xml file). It is also user the
    Portal User Controls.
    Everything works fine in .portal file. However, in streaming mode, from a jsp
    when I click on an netui:anchor, the action gets executed, but then it redirects
    to the home page, not to the page which has the portlet.

    More info: I can place a page component on my page flow diagram but I cannot place any other components. They won't display. Placing the page component on the diagram does not put code into the source file. Also, I get the following compile error: Error(1,1):<Line 1, Column 1>:XML-20108:(Fatal Error) Start of root element expected.
    Thanks!

  • NI-8452 Stream Mode more than 64bits?

    I hava an SPI ADC which I want to read using the stream API for high conversion rates (using the NI-8452) but want to read back all 7 ADC channels in one multi-read SPI command. The maximum number of bits that the stream API seems to support is 64 bits where I need to really read out about 232 (7 x 32 + 8 for the read command). Is there any way around this?
    I use the stream mode to detect a DRDY event, but once a single channel is read the output on the ADC chip is reset (so subsequent interrupts will only be generated on new data).
    Seems fairly limited otherwise.
    Solved!
    Go to Solution.

    David,
    The payload that you are trying to stream is not a standard for SPI. We try to follow the SPI standards and give you up to 64 bits to stream at a time. If you cannot split your reads into separate 64 bit reads, you will be unable to perform this operation with the 8452. If you had some other interface, such as FPGA, you my be able to implement a custom SPI protocol on the FPGA. With the 8452, however, you do not have these options.

  • 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.

  • Stream-Mode Sockets

    Hi, I am working through a pradtice paper. I need to learn something for tomorrows exam.
    Here is the Question
    2b) Write detailed Java pseudo code fragments using stream-mode sockets. The code should reflect the following scenario:
    •     the server listens on a particular socket
    •     the client requests for a connection;
    •     the server accepts the connection request;
    •     the server sends the message “Send me a line of text” to the client;
    •     the client receives the message;
    •     The client sends the string “here is a line of text.”
    •     The server receives the line
    •     The server changes the text into upper case
    •     The server sends the changed text back.
    •     The client receives the changed text.
    Although your code does not need to be syntactically correct, it needs to be detailed enough to show the correct understanding of how the host addresses and port numbers are related to the sockets; it needs to show the correct use of classes and methods.
    So Far I have found thins:
    Client:
    package NetworkProgramming;
    import java.io.*;
    import java.net.*;
    public class Client2 {
    public static void main(String[] args) throws Exception {
    Client2 myCli = new Client2();
    myCli.run();
    public void run() throws Exception {
    Socket mySkt = new Socket("localhost", 9999);
    PrintStream myPS = new PrintStream(mySkt.getOutputStream());
    myPS.println("Hello Server");
    BufferedReader myBR = new BufferedReader(new InputStreamReader(mySkt.getInputStream()));
    String temp = myBR.readLine();
    System.out.println(temp);
    Server:
    package NetworkProgramming;
    import java.io.*;
    import java.net.*;
    public class Server2 {
    public static void main(String[] args) throws Exception {
    Server2 myServ = new Server2();
    myServ.run();
    public void run() throws Exception {
    ServerSocket mySS = new ServerSocket(9999);
    Socket SS_accept = mySS.accept();
    BufferedReader SS_BR = new BufferedReader(new InputStreamReader(SS_accept.getInputStream()));
    String temp = SS_BR.readLine();
    System.out.println(temp);
    if (temp != null) {
    PrintStream SSPS = new PrintStream(SS_accept.getOutputStream());
    SSPS.println("got Something");
    Is this the right stuff?
    How can i implement the parts in the question into this. like the sending messages, change to upper case etc.
    Many thanks for your help.

    1. When posting code, use code tags so it will be readable: http://forums.oracle.com/forums/ann.jspa?annID=1429
    2. You'll find you get better responses if you ask a more specific question and show your attempt to solve the problem yourself, as opposed to just pasting your assignment and some code you "found" and then asking, "How do I do the rest of this?"

  • Strange, occasional, aborts of html response stream...

    Apex 4.1 with Apache, mod_plsql and gzip compression.
    This application is used by 2000+ users in Netherlands and Belgium.
    We have a few Belgium customers with the following issue (confirmed at one site, but I suspect the others have the same issue).
    Application works fine most of the time, but occasionally the html that is produced by the http-get call of 'f', is:
    a) streamed back to the browser in 'chunks', with large delays (> 60 seconds) in between.
    b) sometimes even never completes (in streaming all html back to the browser).
    We've observed this behavior by monitoring what's going on using Chrome's ctrl-shift-i, monitor network, feature.
    Also used WireShark to see if something unusual was happening: but it was not. No dropped packets, resends, or strange http errors.
    When we, in case this is happening, abort the page-request via the browser, and re-submit the request (by requesting the same Apex url again), it then always executes and completes normally.
    My main question now is: how can we diagnose this issue further?
    (I probably provided way too little information here, so feel free to post further clarification requests.)

    ok,
    I removed the html tags in the jsp-file and now acrobat reader does start.
    but it says the pdf file is damaged and cannot be repaired ...
    any ideas?
    gr
    Steppe

  • Sound choppy in Stream mode.

    I placed my audio in the timeline, but I want it streamed rather than event driven because people will be jumping around the timeline.  When I change the sound to Stream the audio gets incredibly choppy. 
    Any ideas?

    that's what you would expect with streamed sound.  you should preload the swf that contains that streamed sound if you want to prevent audio/visual glitches.

  • ITunes Server - each music item is doubled in stream-mode only

    Today I have set up iTunes Server on a Windows Home Server (Acer H320). I have moved all music-files to the server, kept all mediathek-files on client locations and everything seem to be fine. Same amount of music files before and after the measure as described.
    After I have activated iTunes Sever on the Server the Home Server can be seen and toggled in iTunes. Problem is, that each music-file is to be seen twice, one file not avaiable the other avaiable. What has happened?

    can't get any feedback, eh? Well, if it helps, the ipod is fully charged, i have uninstalled and reinstalled itunes about 10 times, removed the registry key low and high end, changed my startup configuration, and everything else that i can find listed on the support site. no luck.
    any help?

  • How to stream video AND sync Music + iPhoto from the same iTunes library ?

    Hi everybody, my iTunes library is full of Music and with movies "linked" outside itself (to a external hard disk connected to my iMac), I'd like to sync this iTunes library to my AppleTV as follows:
    1) the video should be set in streaming mode hence itself not being copied to ATV hard disk;
    2) the music and my iPhoto library should be sync'ed (hence copied!) to ATV hard disk.
    How could I achieve that ?
    Thanks a lot.
    dalrmi.

    Custom sync with Photo set to sync preferentially and all music syncable checked in the device music tabs.

Maybe you are looking for