Non Blocking Call with OCCI

Hi Everyone
I have searched through the whole OCCI documentation and could not find a way to make an asynchronous call to the database. you see the issue we have is that we need to cancel a call to the database if it does not return within the timeout value set. However, OCI does have the cancelling mechanism, but we have doned some testing and the Binding and Defining parameters call take to much of memory and and CPU. Once in a while it runs out of memory.
Has any body come across this problem, and what solutions do you have i mind

andyman35uk wrote:
This doesn't seem to work under 10g. Both getOCIServer and getOCIServiceContext seem to return invalid handles.
See Oracle Bug 3616743 - Oci Svcctx Handle Derived From Occi Connection Class Is Invalid
The invalid handle was most likely the error handle, not the service context nor server handles as kmohan indicated above. The error handle needs to be allocated first.
For reference:
OCIError *errhp;
OCIHandleAlloc((dvoid *)e, (dvoid **)&errhp, (ub4)OCI_HTYPE_ERROR, (size_t)0, (dvoid **)0);
OCISvcCtx s = ((Connection )c)->getOCIServiceContext();
sword r = OCIBreak(s, errhp);
// check r and errhp for errors before reusing them
r = OCIReset(s, errhp);
// check r and errhp for errors
OCIHandleFree((dvoid *)errhp, (ub4)OCI_HTYPE_ERROR);

Similar Messages

  • Non-blocking execution with Pro*C/C++

    Hi readers,
    Is there any mechanism available through which Non-blocking execution with Pro*C/C++?
    I observe that Pro*C queries are hanged when the DB server (hardware) is down.
    I understand that OCI provides non-blocking mechanisms. Pro*C doesn't use this OCI functionality?
    Regards,
    RajaGopal Maddi

    You can use TAF to handle your db down scenario.
    http://www.oracle.com/technetwork/database/app-failover-oracle-database-11g-173323.pdf

  • Non-Blocking call to read the Keyboard

    does anyone know how to make a JAVA program make a non-blocking call to read the keyboard? eg. write a program which generates prime number until a keyboard key is pressed.

    if you use a gui you can use keyListener
    Would work only if your gui elements have focus right now.

  • HT1688 How can I block calls with my IPHONE

    Researching the internet shows that you have to jail break the IPHONE to be able to block phone numbers. Did the designers forget to design the application with the IPHONE? There has to be a way to block phone numbers without jail breaking the phone. Just about every cell phone out there has that ability, why not the IPHONE?

    Mark0157 wrote:
    Just about every cell phone out there has that ability, why not the IPHONE?
    FYI:
    No cell phone has the ability to block calls/sms's...none. True blocking must be done by the carrier, as there is no other way to block calls/sms's.

  • HT1688 Can I block calls with iPhone 5?

    Is there a way to block calls and messages to iPhone 5?

    There is nothing native to the iPhone 5 to block phone calls. Phone call blocking is generally handled at the carrier level. Check with your carrier and see if they provide blocking services.

  • Non-blocking JDBC with Oracle OCI

    I have been monitoring performance for a batch type application in a production environment over the last couple of weeks and all indications are that the blocking JDBC actions are the cause of performance issues in the application. The data access layer is built on Hibernate. And while HIbernate is a fine ORM, and does a great job of creating lightweight, fast individual pieces of SQL, I fear it is the sum of these parts that is causing our problems. I consistently see the Hibernate BatcherImpl getResultSet as consuming the most exclusive time in processing. Of course this is related to the structure of the target database as a lot of this time is being spent in execution.
    What appears to be happening is that the executing threads are blocking until they get a response from the database. We are currently using Thin connections, on 10.2.x drivers. On last reading our processor queue length was as high as 70!! This is a clear indication of a CPU bottleneck.
    I was wondering if it is possible to configure non-blocking JDBC using the OCI type connections instead of Thin connections....
    Any advice someone could give on this topic would be much appreciated.
    Thanks much in advance,
    Jay

    Hi Thomas,
    Thank you for the reply. I am aware that only one statement can be executed on a connection at any given time, and we have connection pooling configured, so that's not a problem.
    More specifically what I am looking for here is that when a thread executes a sql statement using a connection, it seems to block on the processor, it does not switch out, thus not allowing other work to be done while the database satisfies the sql statement. I was wondering if OCI connections were used would the thread switch out until a response was recieved from the database.

  • Nokia 1110i:Making non-emergency calls with keypad...

    I can make calls with Nokia 1110i with its keypad locked.
    Moderator note: e-mail address removed. It is unwise to publish personal contact info on the public boards.
    Message Edited by michaels on 28-Apr-2008 03:20 PM

    Id just like to add that ive had my N80 for 3 weeks now, and 3rd day of using it, my N80 did the same thing, made ghost calls.
    It must have used about a minute or 2s worth of calls.
    I was actually on a stage doing a mobile disco, getting up and down off the stage, when i noticed id received a message from a friend, but also the log had said i called them also.
    The phone was set to locked, ie press the power button, and enter your sec code to unlock phone before it can be used.
    How it had done it i dont know, but maybe it was because id recieved a message, it decided to call that person.
    it did it at least on 2 occassions while the phone was in my pocket, although it hasnt done it since.
    I also dont use a leather or plastic case of any kind.
    Im using firmware for n80 on H3g uk.
    v3.0618.0.2
    23-05-2006
    RM-92
    NOKIA N80 (45.02)
    so in my case, very strange. I could have understood it if the slidy lock was just enabled, but the full lock was on, when my ghost call happened.

  • Non-blocking J2EE calls

    We wish to connect fat clients (in our case Powerbuilder) to a J2EE environment (Weblogic). We also need to make some of the calls from the fat client non-blocking (asynchronous). With many clients, JMS was rejected as a mechanism.
    Our first solution, which works as a prototype, was to package a Java bean as an OLE object and deploy it to the client. This bean could make the calls non-blocking. However there are registry issues (the packaging implies a pre-defined directory structure), we need a JRE on every client and 15Mb of weblogic jars (aaargh), so it only really works as a prototype.
    The next (current) solution is a C dll that can be called from Powerbuilder and uses a socket to talk to a Java J2EE Gateway on the server. This Gateway makes the system non-blocking and calls the EJBs. This is clearly easier in terms of configuring the client.
    Ideally we would like to drop the Gateway by finding a non-blocking way to get into J2EE from the C dll but the only methods we have thought of:
    - simulating an HTTP servlet call
    - SOAP
    are synchronous (or appear to be, my knowledge of SOAP is limited).
    Has anyone come across other ways of getting non-blocking communications with J2EE?

    CORBA, this is what it was designed to do, but it is not not a light weight solution.

  • Non blocking stored proc call

    HI
    I have written a c application using OCI which can call stored proc. but that is using blocking call. Is it possible to call stored proc in non blocking mode? So that I can receive output in call back function. Actually stored proc take much time to execute can I associate some Subscription callback-function with my stored proc call. Any idea?
    Thanks
    Kamran

    If you want to do non-blocking calls in OCI, you just need to set the server handle (svrhp below) attribute:
    sb2 polling=1;
    OCIAttrSet((dvoid *)svrhp,
    (ub4)OCI_HTYPE_SERVER,
    (dvoid *)&polling,
    (ub4)0,
    (ub4)OCI_ATTR_NONBLOCKING_MODE,
    (OCIError *) errhp);
    And then you call you OCIExecute() as you would in blocking mode. The difference is that instead of blocking until the call is done on the server, it always returns immediately. So instead of calling it just once per statement and checking the return code, you must keep calling OCIExecute() until it does not equal OCI_STILL_EXECUTING. When the proc is done, the final call to OCIExecute() will then be OCI_SUCCESS, OCI_ERROR, whatever happened.

  • Non-blocking ServerSocketChannel.accept()

    This may be a dumb question, but what would the motivation be behind utilizing a non-blocking call to the accept method of the ServerSocketChannel? I'm just having a hard time thinking of any, although I'm sure there are good reasons for doing it.
    Thanks,
    Ken

    it does seem pretty strange

  • What's a "Blocked Caller"

    On my "Recents" list is a call I received from a caller named "Blocked" - upon tapping the info arrow on the right - I see that the caller is named Blocked Caller with a date and time.
    Have I blocked this caller? Can I "unblock" callers or is this happening on the other end? Is this a phone issue, address book function I am missing or an ATT function (I am new to ATT as of the iPhone)?
    Any input would be appreciated - Thanks in advance.
    BTW - the phone is amazing - Cheers to Apple on an impressive 1.0 release... as a frequent early adopter the iPhone beats the pants off of say... Aperture... which I now use regularly in my work flow, but which was a dog of dogs upon initial release.

    This is an indication that the originator of the call to you has blocked the caller ID information normally forwarded from one carrier—landline or wireless—to another. Most carriers have a configurable option to allow you to prohibit the receipt of calls at your number when this information is blocked.
    There are some legitimate reasons for blocking caller identity, but most are the result of parties attempting to disguise call origins: telemarketers, collection agencies and others are well know for routinely doing so.
    Consider adding your iPhone mobile registry to the national DO NOT CALL list to diminish such behavior, and contact at&t customer support to determine if you can add or enable a typically free 'do not accept blocked calls' option to your account.

  • OCCI and non-blocking

    I'd like to use the OCCI interface in a non-blocking mode. Does anyone have any experience with this? Looks like I need to use a combo of OCI and OCCI calls to set the OCI_HTYPE_SERVER handle with the OCI_ATTR_NONBLOCKING MODE. However, my stmt->executeQuery() method seems to be throwing an exceptions, which I would have though would have been the OCI_STILL_EXECUTING error, but it's not. The exeception is an "ORA-32103 error from OCI call". If I continue to do another stmt->executeQuery(), I eventually get an access exception.
    Anyone have any code snippets using OCCI in non-blocking mode?

    I use threads. ACE/TAO to be precise.
    I have singleton class that manages the Oracle environment and connection as well as being a statement
    factory.
    Just have a thread perform your stmt->executeXXX() method and you will not need to worry about non-blocking.
    That's how I do it and it works well.

  • Using OCIBindDynamic with non-blocking connections

    I need to use an OCI array interface for execute statements more than once per one request to server.
    When I have called stored procedure or function in the non-blocking connection context using OCIBindDynamic for parameter binding, application have been crashed at random time.
    I don't have any problems using default (blocking) mode.
    Environment:
    Oracle 8.1.7 release 3 for Windows
    MS Visual C++ 6.0 compiler
    Could anybody help me ?

    It's always possible in any read that the number of bytes read is less than the number of bytes requested. You need to keep reading until you have got everything you expected, and cope with every possible error condition on each iteration.
    EJP

  • NIO: Strange problem when using ByteBuffer with non-blocking SocketChannel

    Hi,
    I have a server that uses multiplexed, non-blocking I/O with java.nio. When a client connects, the server waits for the message: <system cmd="knock"/>, returns a message and disconnects the client. The clients are shortly serviced in less than a second.
    But the server newer receive anything from about 20% of the clients - even though it is sent. Or with other words: it is received and the data is contained in the ByteBuffer - SocketChannel.read(ByteBuffer) - but a call to ByteBuffer.remaing() returns 0 !!
    ByteBuffer receiveBuf = ByteBuffer.allocate(65536);
    receiveBuf.clear(); // the code is elsewhere used for longer living clients
    int readBytes = channel.read(receiveBuf);
    receiveBuf.flip();
    StringBuffer sb = new StringBuffer();
    System.out.println(" * Remaining: "+receiveBuf.remaining()); // writes: ' * Remaining: 0'
    System.out.println(" * Received: "+new String(receiveBuf.array())); // writes: ' * Received: <system cmd="knock"/>'
    while(receiveBuf.remaining() >= 2) {
      byte b = receiveBuf.get();
      sb.append((char)b);
    System.out.println(" * sb content: "+sb.toString()); // writes: ' * sb content: 'The ByteBuffer clearly receives the correct data, but the ByteBuffer.remaining() returns 0 and therefore the StringBuffer will never have any content.
    The problem seems to occur randomly and for about 20% of the clients (simulated from the same computer and therefore has the same bandwidth and so on).
    Anyone knows what is going on, and how to solve the problem !?

    It's always possible in any read that the number of bytes read is less than the number of bytes requested. You need to keep reading until you have got everything you expected, and cope with every possible error condition on each iteration.
    EJP

  • Using non blocking connect() call for SCTP sockets in Solaris10

    Hi,
    I have a problem with non blocking connect call on SCTP socket.
    I am using the sctp stack support in Solaris10.
    When the connect is successful, I can get the pollout event on the socket.
    But there is no event observed when the peer does not exist. In other words, I could not get the pollout event on connection failure. This logic works fine with TCP sockets on both Solaris and Suse10.
    I am working with SCTP one-to-one style sockets.
    Is there any way to handle this issue?
    Do I need to load any patch to resolve this issue?
    It will be great if I get a solution in this regard.
    Thanks in advance.
    Best Regards,
    Bipin.

    There are at least two problems here.
    A. In the receiver you should test for -1 from the read() immediately, rather than continue with the loop and try to write -1 bytes to the file.
    B. In the sender you are ignoring the return value of client.write(), which can be anything from 0 to the buffer length. If you get 0 you should wait for another OP_WRITE to trigger; if you get a 'short write' you need to retry it until you've got nothing left to write from the current buffer, before you read any more data. This is where the data is vanishing.

Maybe you are looking for