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

Similar Messages

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

  • Broken Pipe with Non-blocking Socket

    Hello,
    I write a Unix Agent who connect on a Windows Server with socket...
    Working well on Linux but on Solaris my problem is:
    -When my agent is running before server at connection all seems OK: Connect, Select and Getsockopt but when I try to send data I have always EPIPE Signal but I can receive datas from server !
    - When my agent is strarting after the server all it's Ok
    I don't unserstand this appears on Solaris SPARC 8 and Solaris 9 Intel ...
    Please Help is there something special with non-blocking sockets on Solaris ?
    Thanks

    Can't help you much but what I would recommend is that you
    insure that your pipes are opened for both read/write, even
    though you are only going to read or write from it. This insures
    that the pipe does not close down when you hit EOF.

  • Non-blocking connection on a SocketChannel?

    I'm trying out the non-blocking connection of a SocketChannel. So I wrote the following test code and supply a list of IPs (both good and bad IPs). But disregard the IPs I always get the result of a channel being in connection pending state (even for some bogus IPs). Any help will be great.
    public class ConnectTest
        public static void main(String[] args) throws
    Exception
            List<SocketChannel> channels = new ArrayList<SocketChannel>();
            for ( String s: args )
                SocketChannel channel = SocketChannel.open();
                channel.configureBlocking(false);
                channels.add(channel);        
                InetSocketAddress remote = new InetSocketAddress(s, 80);
                channel.connect(remote);
            System.out.println("wait for timeout...");
            Thread.sleep(10000);
            for ( SocketChannel c : channels )
                if ( c.isConnected() )
                    System.out.println(c.socket().getInetAddress() + " connected ");
                else if ( c.isConnectionPending() )
                    System.out.println(c.socket().getInetAddress() + " connection pending ");               
                else
                    System.out.println(c.socket().getInetAddress() + " timeout ");
                c.close();
    }

    Forget the sleep: use a Selector, selecting on OP_CONNECT. When you get it, call SocketChannel.finishConnect() for the channel(s) selected. If that method returns 'true', the connection is complete. If it returns 'false', the connection is still pending (and in fact OP_CONNECT should not have fired); if it throws an exception, the connection attempt has failed.
    If the connection is complete you must also deregister it for OP_CONNECT before registering it for OP_READ or OP_WRITE.

  • JDK 1.4 nio non-blocking connects don't finish

    I am working with the Linux version of JDK1.4, doing some testing of the
    non-blocking capability. The few tests that I have done have shown some
    strange results:
    - When opening a non-blocking connection to a server which has an
    announcement banner, say such as POP which gives something like:
    +OK pop3 server ready
    then connection seems to be OK and proceed through to completion.
    - When opening a non-blocking connection to a server which is silent, and
    expects me to start the conversation, such as contacting an HTTP server,
    then the Selector.select() never returns to allow me to finish the
    connection.
    Below is a test program which illustrates the problem for me.
    It attempts to open a non-blocking connection to www.yahoo.com on port 80.
    It then drops into a Selector.select() where I am waiting for the chance to
    catch the SelectionKey.OP_CONNECT event and finish connecting, and then send
    a simple HTTP GET request down the wire. That OP_CONNECT event
    never seems to arrive though, and I remain stuck in the select().
    'netstat -na' shows that I am in a connection established state.
    Any insight appreciated,
    -Steve M [email protected]
    ------------------>8 cut here 8<-----------------------
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.nio.*;
    import java.nio.channels.*;
    public class NoWorkee
    public static String GET_REQUEST = "GET / HTTP/1.0\r\n\r\n";
        static class Context
            String host;
            int    port;
            ByteBuffer request;
            public Context (String h, int p, ByteBuffer r)
            {host=h; port=p; request=r;}
    Selector sel = null;
    boolean keepGoing = true;
    public NoWorkee()
        throws IOException
        sel = Selector.open();
    public void add(String host, int port)
        throws IOException
        int ops = SelectionKey.OP_CONNECT;
        // create non-blocking socket, and initiate connect operation
        SocketChannel sc = SocketChannel.open();
        sc.configureBlocking(false);
        sc.connect(new InetSocketAddress(InetAddress.getByName(host), port));
        SelectionKey sk;
        try
            sk = sc.register(sel, ops);
            System.out.println ( "sc.register looks good connected=" +
                sc.isConnected() + ", isConnectionPending=" +
                sc.isConnectionPending());
            sk.attach(new Context(host, port, ByteBuffer.wrap(GET_REQUEST.getBytes())));
        catch (IOException x)
            x.printStackTrace();
            sc.close();
    public void run()
        throws IOException
        keepGoing = true;
        System.out.println ( "Selecting " + sel.keys().size() + " SelectKeys");
        while (keepGoing)
            final long before = System.currentTimeMillis();
            final int numReady = sel.select();
            //final int numReady = sel.select(1000);
            final long after = System.currentTimeMillis();
            System.out.println ( "Blocked " + (after-before) + " ms, numReady=" + numReady);
            if (numReady > 0)
                Set readyKeys = sel.selectedKeys();
                System.out.println ( "Selected keys size " + readyKeys.size());
                for (Iterator it = readyKeys.iterator(); it.hasNext();)
                    SelectionKey sk = (SelectionKey)it.next();
                    SocketChannel sockChan = (SocketChannel)sk.channel();
                    Context ctx = (Context)sk.attachment();
                    System.out.println ( "Servicing host " + ctx.host + " port "
                                 ctx.port);
    System.out.println ( "1");
                    if (sk.isConnectable())
                        if (sockChan.finishConnect())
                            System.out.println ( "Finished connecting success "
    + sockChan);
                            int ops = SelectionKey.OP_READ | SelectionKey.OP_WRITE;
                            sk.interestOps (ops);
                        else
                            System.out.println ( "Could not finishConnect for "
                                sockChan);
                            sk.cancel();
                            sockChan.close();
    System.out.println ( "2");
                    if (sk.isAcceptable())
                        System.out.println ( "in sk.isAcceptable() block");
    System.out.println ( "3");
                    if (sk.isReadable())
                        System.out.println ( "in sk.isReadable() block");
                        byte rawBuff[] = new byte[32 * 1024];
                        ByteBuffer buff = ByteBuffer.wrap(rawBuff);
                        int numRead = -1;
                        while (0 < (numRead = sockChan.read(buff)))
                            System.out.println ( "numRead = " + numRead);
                            for (int i = 0; i < numRead; i++)
                                System.out.print((char)rawBuff);
    System.out.println ( "numRead = " + numRead);
    System.out.println ( "4");
    if (sk.isWritable())
    System.out.println ( "in sk.isReadable() block");
    int numWritten = -1;
    if (null != ctx.request)
    numWritten = sockChan.write(ctx.request);
    if (!ctx.request.hasRemaining())
    sk.interestOps(sk.interestOps() &
    ~SelectionKey.OP_WRITE);
    System.out.println ( "numWritten = " + numWritten);
    //else
    // service timeouts
    public static void main (String arg[])
    try
    NoWorkee bla = new NoWorkee();
    bla.add ("www.yahoo.com", 80);
    bla.run();
    catch (Exception e)
    e.printStackTrace();
    ------------------>8 cut here 8<-----------------------

    Just for the benefit of anyone who might be seeing the same problem, it looks like bug 4457776 accurately describes the problem that I was having above.
    I am downloading j2sdk-1_4_0-beta2-linux-i386-rpm.bin to see if that fixed it.
    Reference:
    http://developer.java.sun.com/developer/bugParade/bugs/4457776.html

  • HT201210 I'm trying to update my iOS to 6.0, using iTunes (with my 4s connected via USB and WiFi is on also). I get a message that 'there are purchased items on my iPhone that have not been transferred to my iTunes library. Yet, I can't find those items!

    I'm trying to update my iOS to 6.0, using iTunes (with my 4s connected via USB and WiFi is on also). I get a message that 'there are purchased items on my iPhone that have not been transferred to my iTunes library. Yet, I can't find those items! Help!  There is not error message number just the text message. I've searched for an answer but have found nothing on "transfering items purchased to your iTunes library".

    Right click on your device icon on the left pane of iTunes and click on transfer pur....

  • How to use labview with gpib to connect with Agilent PNA E8362B ?i am newbie ..just started to work on labview about a fortnite bck and a novice in interfacing skill ..so plzzzzz explain me in a litle detail

    how to use labview with gpib to connect with Agilent PNA E8362B ?i am newbie ..just started to work on labview about a fortnite bck and +i am a novice in interfacing(networking... jst know tidbits) skill ..so plzzzzz explain me in a litle detail

    Sir
    We were able to solve that problem...but now could you advice as to which DC power supply we should use (preferably avalable in India) so that it can be controlled by Labview (through a gpib/rs232/any other port) to give a square wave of desired frequency/other parameters.
    Regards
    Shivam

  • How to use labview with gpib to connect with Agilent PNA E8362B ?

    how to use labview with gpib to connect with Agilent PNA E8362B ?i am newbie ..just started to work on labview about a fortnite bck and +i am a novice in interfacing(networking... jst know tidbits) skill ..so plzzzzz explain me in a litle detail

    Duplicate Post.

  • Workaround to use drives with 4096b block for mirrored RAID?

    I have 2 Hitachi 2TB Drives. One is a few months old and uses 512b blocks, the other is the same model, but newer and uses 4096b blocks.
    When I try to set up the RAID Set I get the error: MediaKit reports block size error, usually caused by not being a multiple of 512.
    From reading the message board, it looks like this a known bug when trying to encrypt drives with 4K block sizes or add them to a RAID Array.
    Is there any way to set these up as a mirrored RAID array other than waiting for apple to fix the problem? Are there third party apps that can be used to fix this problem?
    Thank you for your time.

    I have the exact same problem, and until Apple solves this bug, I no longer have a hard drive large enoug for my Time Machine back-ups. I have submitted the bug, but I really need a solution. Please help!

  • Use BIBeans with non-Oracle development / appserver products?

    Hi,
    Is it possible to BIBeans with non-Oracle development tools (netbeans/forte etc.) and appserver products?
    Where can I find more info?
    TIA..

    Hi Nilesh,
    Yes it is definitely possible to use other IDEs for BIBeans development but use of JDeveloper makes it really easy as it has got lot of BI Beans wizards. In other IDEs though it is possible, it will be very tedious to create reports and graphs etc and do over all development.
    As far as deployment on other appserver goes, I have deployed BIBeans applications (Servlet) on atleast 3 containers (Tomcat, OC4J and weblogic). Since BIBeans builds a standard java servlet application, it should be possible to deploy on any servlet container.
    Hope it helps.
    Shantanu

  • Using SVTI with non Cisco peers

    Hello Community,
    I have a particular setup in mind, but can't get it to work in a GNS3 environment to have it tested before trying it in our production setup.
    We have a setup using two VPN routers (3845) with HSRP, BGP and VRF (with rri), using a classical setup with crypto maps, connecting other parties to our DC. We do not manage the peer hardware in these cases.
    I'm have been looking into the possibilities to move from this setup, to a setup using SVTI with IPSEC. This change must be transparant to our peers; no config changes should be needed on their component(s).
    So I've build our setup in GNS3 (apart from the BGP and VRF) to test this. I have the current IPSEC VPN with crypto maps working in GNS3, with both sides using the same (Cisco) setup in terms of ISAKPM and IPSEC with an ACL.
    I've made the changes on "our" HSRP VPN setup according to "IPsec Virtual Tunnel Interface" guide from the Cisco site in GNS3 (can't seem to find the link to the online doc).
    It looks like the tunnel is being build, but phase two is not completing, because of, I think, the mismatch between both peers on the ecnryption domain. the VTI side uses routing through the Tunnel interface, sending "IP any any", to the peer, whereas the peer uses a ACL expecting a specifc source and destination.
    Here's a debug snippet (ignore the date/time) seen from the peer (using an ACL):
    *Mar  1 02:02:45.199: IPSEC(validate_transform_proposal): no IPSEC cryptomap exists for local address xx.xx.xx.xx
    *Mar  1 02:02:45.199: ISAKMP:(0:9:SW:1): IPSec policy invalidated proposal
    *Mar  1 02:02:45.199: ISAKMP:(0:9:SW:1): phase 2 SA policy not acceptable! (local xx.xx.xx.xx remote yy.yy.yy.yy)
    *Mar  1 02:02:45.199: ISAKMP:(0:9:SW:1):Sending NOTIFY PROPOSAL_NOT_CHOSEN protocol 3
    In this post, https://supportforums.cisco.com/message/3052235#3052235, it is suggested that when using a setup with VTI's, both sides/peers should use the same kind of setup i.e. VTI. I can imagine this to be realistic when you manage both peers.
    All Cisco docs assume both peers use (S|D)VTI.
    My questions:
    1. Is it possible to have a setup where PeerA (Cisco hadrware) uses SVTI with IPSEC and PeerB is unknown (can be any vendor) or uses some kind of ACL and given that all other encryption settings match
    2. Does anyone has experience with such a setup ? If so can you provide me with an example configuration
    3. Is there an other similair solution using a virtual interfaces or a loopback interface ?
    Thank you kindly for your input.
    Avinash
    I hope you can help me

    Hi there,
    Here is the related info for BE3000;
    Q. Does Cisco Business Edition 3000 support third-party SIP phones and shared-port-adapter (SPA) phones?
    A. No.
    From;
    http://www.cisco.com/en/US/prod/collateral/voicesw/ps6788/vcallcon/ps11370/qa_c67-697016.html
    Cheers!
    Rob
    "Talk about a dream
    Try to make it real" 
    - Springsteen

  • Permission Error when copy files into cmsdk using NFS with non admin user

    Hi All,
    We are using CMSDK with NFS protocol and we have created different users with ACL to control different access for users.
    When we copy files into cmsdk folders using one of the admin user this works fine, even a multiple copy works fine. But when we use any non admin user , some time copy commands works but some time it throw a permission deny error. and this is happening very intermittently.
    when we use ftp protocol and ftp file it's all works fine for the both admin & non admin user. Is there any limitation in using CMSDK NFS protocol
    Did any one encouter any similar issue. Any pointers would be of great help.
    Thanks in advance
    Regards,
    Navin

    Hi All,
    We are using CMSDK with NFS protocol and we have created different users with ACL to control different access for users.
    When we copy files into cmsdk folders using one of the admin user this works fine, even a multiple copy works fine. But when we use any non admin user , some time copy commands works but some time it throw a permission deny error. and this is happening very intermittently.
    when we use ftp protocol and ftp file it's all works fine for the both admin & non admin user. Is there any limitation in using CMSDK NFS protocol
    Did any one encouter any similar issue. Any pointers would be of great help.
    Thanks in advance
    Regards,
    Navin

  • Using Keynote with USB Vga connection

    I'm trying a new setup for two projectors, where I'm hooking up one using a mini displayport on an imac, connecting it via DVI, and a second one through a USB VGA connection. Previously, we were using a VGA splitter off the displayport, which kept me from having a digital connection for the one (better) projector.
    This setup seems to work fine except in Keynote. I have the two projectors setup to mirror each other, while the imac serves as the main display. In other programs, the mirroring works, but in Keynote, when I activate the slide presentation, the VGA projector goes black. To my untrained eye, it appears as if Keynote is overriding the OS' display setup, and is only using the display port's connection as the secondary display.
    Hope I'm explaining this well enough. Anyone have any suggestions?

    In my experience, most current business projectors will display at 1024 X 768, although older/cheaper models may have a native resolution of 800 X 600. Most projectors can rescale some higher resolutions, but I'd say that you're safest to not go above 1024 X 768. Also, although some projectors will have digital inputs, many business projectors will not, and so it is vital to have the VGA connector. While you may lose a bit of quality, in the cases where you need it, you won't likely have any other option.

  • Using AEBS with non-wireless Mac mini to connect with modem wirelessly

    Daughter has a Mac mini w/o wifi on 2nd floor and DSL wifi modem which must be located on 1st floor. Due to other old computer, modem is configured to 64-bit WEP for wireless.  Want to add mini to her network.  (I've discovered that 40-bit mode on AEBS is really 64-bit mode.)
    I'm trying to use a new Airport Extreme Base station by connecting mini to AEBS via Ethernet cable.  Then I'm hoping to configure AEBS to connect to the DSL modem wirelessly - don't know if that is possible.  I tried setting AEBS to "join a wireless network".  It finds the DSL network, so I enter the modem's password. I've then gone through a number of configurations on AEBS but each time, when AEBS restarts, it doesn't get out of yellow blinking light or (on one try if I recall correctly) I got the green light - but then Airport Utility is never able to find AEBS and I end up starting from scratch by resetting AEBS.
    1) Can I even use AEBS to connect to a wireless network and have a Mac wired to it so the Mac can reach the Internet?
    2) if yes, what wireless mode should I set AEBS to?  What other settings do I need to get right?
    Thanks

    This is a "n" version of AEBS.
    Please refer back to the previous posts. I was talking about an AirPort Express (AX) as the device that has this special feature.
    Ironically, the less expensive AirPort Express will do what you want with a special feature that allows it to "join" a wireless network and then enable the Ethernet port.
    If you have an AirPort Express 802.11n, I will post the steps for you if you want them.

Maybe you are looking for

  • Add counter in FTP receiver file adapter

    Hello, I have sen that in a File System (NFS) you can add a counter to the filename, but I don't found this possibility when I put File Transfer Protocol (FTP), I only see to add timestamp or message id. There is some possibility to add the counter i

  • Problem with 2nd operating system

    Hello, I have a near new probook. When purchased,  I upgraded the hard drive. I still have the original hd with win7 pro installed on it. My problem is,  when I put the original hd into the probook it starts etc but, everything is magnifed and pixela

  • Can't import MPEG4 video into iDVD 5

    I am trying to create a DVD using MPEG4 video that I downloaded from iTunes. (I need to create a DVD of the Wonderpets TV show for my son for Christmas.) iDVD 5 doesn't recognize it, nor does iMovie HD 5, nor does Toast Titanium. I am assuming that e

  • Multiple Instance Question

    Hi, I installed two instances of Oracle 8.1.7 database. However, at any one time, I can only start one. If I start the other one, I get this error: SQL> startup ORA-24323: value not allowed ORA-03113: end-of-file on communication channel Any ideas?

  • After downloading updates for apps to PC they are not syncing over to phone.

    Hi, I have noticed today that if  I download app updates to my PC for my iphone 4 or ipad 3, they are not updating on the devices when syncing. Running latest iOS on devices and using Itunes 11.0.1.12 Have seen on the app page on PC, you can select e