Force reset OCI Handles

Dear OCI experts,
I'm quite beginner about OCI, and I guess I don't understand what is OCI handles well...
Can we get new OCI handles or reset OCI handles after connection failure?
We have been testing behavior of our application by killing dispatcher process and cause connection failure during global transaction. After that, transaction monitor could automatically restart global transaction. However, OCI handles were seemed to hold old information, and we got errors when the application called OCI function to do some operation to a database.
(In same situation, Pro*c EXEC can execute SQL without any error handling)
We changed our code to get OCI handles again when we get "connection EOF" errors. However, obtained handles are same as before and nothing has changed.
(We call same functions to get OCI handles in initialization process.)
Are there any way to force reset OCI handles or do I have to do something to reset Connection failures?
Thanks.

posting sample code will help. Are you doing OCIServerAttach() and OCISessionBegin() when you are retrying to connect? You should do both, because the socket is broken and the session may be killed if you kill the dispatcher.

Similar Messages

  • Getting OCI HANDLE ERROR

    hi
    I running a big query and i got the result when I tried to save the result it gave me this error OCI HANDLE ERROR
    and then checked on details it says tht some DLL file not found.
    But this issue was not there previously.
    Can you suggest me how to resolve this error ?
    Saravanan

    You should make the OCI NON block by using OCIAttrSet with with
    the attrtype parameter set to OCI_ATTR_NONBLOCKING_MODE before calling OCIBreak().
    You must then issue an OCIReset() call to reset the asynchronous operation and protocol.

  • Invalid OCI Handle when storing Blob in Oracle 11g with OCCI

    Hi,
    I'm getting Invalid OCI Handle ORA-32102 while execute the following code:
    try
                   env=Environment::createEnvironment(Environment::OBJECT);
                   connPool = env->createConnectionPool(userName, password,
                             database, minConn, maxConn, incrConn);
                   conn=connPool->createConnection(userName,password);
                   Blob blobRequest(conn);
                   blobRequest.open(OCCI_LOB_WRITEONLY);
                   unsigned int bytesReqWritten = blobRequest.write((unsigned int)bytesOut, req_buffer, (unsigned int)bytesOut);
                   cout << "Request bytes written "<< bytesReqWritten << endl;
                   blobRequest.close();
                   Blob blobResponse(conn);
                   blobResponse.open(OCCI_LOB_WRITEONLY);
                   unsigned int bytesRespWritten = blobResponse.write((unsigned int)bytesAckOut, resp_buffer, (unsigned int)bytesAckOut);
                   cout << "Response bytes written "<< bytesRespWritten << endl;
                   blobResponse.close();
                   stmt = conn->createStatement("BEGIN STORE_REQUEST(:1,:2); END;");
                   stmt->setBlob(1,blobRequest); <------------------------- Blob here
                   stmt->setBlob(2,blobResponse); <------------------------- Blob here
                   stmt->executeUpdate();
    catch(SQLException &e)
                   cout << "Error in Constructor Call " << endl;
                   cout << "Error Number: " << e.getErrorCode() << endl;
                   cout << e.getMessage() << endl;
         conn->terminateStatement(stmt);
         connPool->terminateConnection (conn);
         env->terminateConnectionPool (connPool);
         Environment::terminateEnvironment(env);
    Anyone can help me? Please.
    Kind Regards, denis

    Hi,
    The correct code for insert blobs must be writed like this:
    try
    env=Environment::createEnvironment(Environment::OBJECT);
    connPool = env->createConnectionPool(userName, password,
    database, minConn, maxConn, incrConn);
    conn=connPool->createConnection(userName,password);
    //1. First insert empty blobs in tables...
    Blob blobRequest;
    blobRequest.setEmpty(conn);
    Blob blobResponse;
    blobResponse.setEmpty(conn);
    stmt = conn->createStatement("BEGIN STORE_REQUEST(:1,:2); END;");
    stmt->setBlob(1,blobRequest);
    stmt->setBlob(2,blobResponse);
    stmt->executeUpdate();
    //2.Select Blobs for update and commit
    stmt2 = conn->createStatement("SELECT REQUEST,RESPONSE FROM STORE WHERE ID=:ID FOR UPDATE");
    stmt2->setString(1,id.c_str());
    ResultSet *rs = stmt2->executeQuery();
    if(rs->next())
    blobRequest = rs->getBlob(1);
    blobRequest.write((unsigned int)bytesOut, req_buffer, (unsigned int)bytesOut);
    blobResponse = rs->getBlob(2);
    blobResponse.write((unsigned int)bytesAckOut, resp_buffer, (unsigned int)bytesAckOut);
    conn->commit();
    else
    conn->rollback();
    catch(SQLException &e)
    cout << "Error in Constructor Call " << endl;
    cout << "Error Number: " << e.getErrorCode() << endl;
    cout << e.getMessage() << endl;
    stmt2->closeResultSet(rs);
    conn->terminateStatement(stmt);
    conn->terminateStatement(stmt2);
    connPool->terminateConnection (conn);
    env->terminateConnectionPool (connPool);
    Environment::terminateEnvironment(env);

  • Invalid OCI handle when creating a Blob

    I have an application that talks to an Oracle 11gR2 database. I am using the OCCI C++ library. I can call SPs with no problem when they do not contain a Blob. Now I need to pass in a Blob to a SP and I am getting an ORA-32102: invalid OCI handle exception thrown when I call blob->open(OCCI_LOB_WRITEONLY). This same style of code works when I call a SP that does not have a Blob parameter so naturally I am confused. What could be wrong with this?
    Thanks,
    Aaron
    FYI, Here's the code segment in question
    Statement *statement;    
    try {
         // create the connection
         statement = myconnection->createStatement();
         // create the start timestamp
         // create the end timestamp
         // create the blob of data
         blob = new Blob(myconnection);
         blob->open(OCCI_LOB_WRITEONLY);  // <---------------------------------------- here the exception ORA-32102 is thrown
         blob->write(packSize,(uint8_t*)dataBlock,dataBlockSize);
         blob->close();
         // create statement and set input parameters
         statement->setSQL("BEGIN network_analysis.update_network_ip(:1,:2,:3,:4,:5); END;");
         statement->setInt(1,dbconnect->networkMetricId);
         statement->setTimestamp(2,startTime);
         statement->setTimestamp(3,endTime);
         statement->setBlob(4,*blob); // setBlob 2nd parameter is a reference
         statement->setInt(5,numEntries);
         statement->executeUpdate();
    } catch (SQLException &e) {
         FATALF("%s",e.what());
    myconnection->terminateStatement(statement); // free resource
    delete blob;Edited by: user8859202 on Dec 16, 2009 12:16 PM

    Update, I found the answer which is streams must be used. The setBinaryStreamMode is used and after executeUpdate, I update the stream.

  • OCCI Error -  ORA-32102: invalid OCI handle

    Hi,
    I'm completely new to OCCI and Linux and trying to run the simple OCCI program given in oracle site (http://www.oracle.com/technology/tech/oci/occi/occibasic.html) to connect a remote Oracle DB server.
    #include <iostream>
    #include <occi.h>
    using namespace std;
    using namespace oracle::occi;
    int main()
    Environment* env = Environment::createEnvironment();
    Connection* conn = env->createConnection("testdb", "testdb", "192.168.10.118:1521/ORADB"); // user, password, url
    Statement* stmt = conn->createStatement();
    stmt->setSQL("INSERT into FRUITS (fruit, amt) VALUES ('apple', 10)");
    stmt->executeUpdate();
    conn->terminateStatement(stmt);
    env->terminateConnection(conn);
    Environment::terminateEnvironment(env);
    return 0;
    When I try to run it after compilation it gives the following error.
    ORA-32102: invalid OCI handle
    The error should be in the line: Connection* conn = env->createConnection("testdb", "testdb", "192.168.10.118:1521/ORADB");
    I could track it by placing a cout<< there.
    Why this is and how can I handle this error? Please post your experience.
    Thanks

    Hi,
    I found the reason. It may due to the permission level of the user "testdb". When I tried with a different user it worked!
    Thanks

  • If createConnection hit "connection lost contact" then "invalid OCI handle"

    I am facing a peculiar error with OCCI API :
    The c++ application make use of OCCI API to interact with 10 different oracle DBs sequentially in loop, but the moment
    pConn = pEnv->createConnection(a_usr, a_pass, a_connection) for 1 slow db is hit with "ORA-03135: connection lost contact" then
    for all the remaining other db execution I get a constant error - "ORA-32102: invalid OCI handle" i.e
    when the control moves to next db then "pConn = pEnv->createConnection" is successful for all the rest db but when
    pRes = pStmt->executeQuery() is executed I get this - "ORA-32102: invalid OCI handle" standard error.
    The rest of dbs are live, cross checked with SQLPLUS.
    The OCCI resources and handlers are initialized in class and remains in memory till the end of the application. In healthy situation the application works fine for all10 dbs and handles all the ORA errors well except for this situation.
    Question: When OCCI hit ORA-03135 error in createConnection method , does OCCI releases the memory (or handlers) ..? If yes then with the same "env" handler why OCCI succeeds in making the next connection and we have correct "con" handler, similarly "createStatement" is also successful but this same "statement" handler the executeQuery() fails with -invalid OCI handle ??
    In healthy situation all logic works just fine, I am able to get the data that means sql queries and resultset handle code is perfect.
    Thanks in advance,
    Vijay

    If you haven't found a solution for this yet, could you post the entire section of code? Please use the code tag to post the code.

  • Force Reset Settings Script for Public Edit Lab

    I work at a public access television station where we have a public edit suite outfitted with several final cut studio workstations. We have several external hard drives that we have our members use instead of the imacs internal drives, so that each project/member can work independent of any specific workstation.
    What I'd like to do is FORCE our members to reset their scratch disks every time they launch FCP, to ensure that they set their scratch disk to their properly named folder on whichever external drive they're using.
    We've had issues where some members forget to set scratch disks, capture to another members project folder, to then come back and see that that other member, not knowing what the other files were, deleted them.
    Is there a simple script I can set to run each time FCP is quit, or on startup/shut down, to ensure that scratch disk settings don't stick for more than one launch?
    Thank you!

    I am not sure I agree with the school of hard knocks perspective. Certainly there are times on a public system that require people to follow basic rules and procedures to get their work done, but the problem is that Final Cut is designed for a single user system, not an open lab account.
    If I purchase a copy of Final Cut and run it on my personal machine I may never even need to look at the scratch disk setting. Even when students do understand how scratch disks work their is the possibility of error. Also it is very easy for one user to mess up another's work.
    This may be the reality of the software but it doesn't mean it is an effective means of managing a public lab. I think finding a way to allow auto reset of the scratch disk would be a healthy reminder to anyone working in a public system, expert or novice. When working in other professional media suites such as protools you are asked to set an equivalent location when creating a new session(equivalent to a project). A similar possible setting in Final Cut would allow it to work in different environments more easily.

  • Firefox freezes upon startup; forced reset everytime.

    Hello, all,
    I'm currently running Firefox 25.0.1 on Windows 7 Home Premium SP1 on a Dell XPS 8300, 64 bit OS. Recently, everytime I start up Firefox, it freezes automatically without my clicking anything. I'm then forced to hold down the shift key, while clicking the Firefox icon, in order to reset the browser. I've uninstalled/reinstalled it a few times, but the problem persists. I believe it might be a script issue, but can't be certain. This scenario plays out everytime I start my computer, which really puzzles me that I need to fix it everytime. Any ideas?
    Thanks,
    Lefky

    There are two things you can try. But first, holding down the shift key
    starts Firefox in Safe Mode. This disables all your add-ons and some
    settings. If the browser works find in safe mode, then the problem could
    be an add-on. But first do this. Go to '''''[https://www.mozilla.org Mozilla.org]'''''
    to download the latest version of Firefox. DO NOT UPDATE. Get the full
    installer. After you download the installer, remove Firefox using the
    windows uninstaller. Then run the FF installer you just got. You will
    not lose much of anything. Now try FF normally. If you still have problems,
    then you will need to reset the browser. This will remove ALL ADD-ONS,
    and reset ALL SETTINGS to their default settings. If the problem is
    gone, then it was one of the add-ons. Re-install your add-ons only a
    few at a time. Close FF, and restart after each group. Good Luck.
    ===================================
    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information. <br>
    '''Note''': ''This will cause you to lose any Extensions and some Preferences.''
    *Open websites will not be saved in Firefox versions lower than 25.
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!
    Thank you.

  • LDAP user password "force reset" compliance.

    Sun JSWS 7.0
    Sun JSDS 6.0
    I have ACLs set up with an LDAP authentication database. When a user logs in and their password is in the warn before expire time frame they are redirected to the URL defined by "Redirect URL" in the "Edit Authentication DB" web server GUI menu. This is (from what I can tell) the proper behavior.
    Here is the issue- when we create a new user we have an LDAP password policy which is supposed to force the user to change their password at first log in. However, the web server does not seem to comply with this policy and simply allows the user to log in. Is there a way to to configure the web server to send the user to the change password page in this case?
    Thanks,
    Jess

    Theoretically I think it should work I will have to test it. Can you check LDAP Server logs and tell me what's happening?
    Currently Sun Java System Web Server 7.0 redirects you to a URL provided when passwords
    1) are about to expire (LDAP Server returns LDAP_CONTROL_PWEXPIRING ) or
    2) have expired (LDAP Server sends LDAP_CONTROL_PWEXPIRED).
    This page is set by administrators to either communicate to users that their password will expire soon (and possibly offer ways to renew it). The way to set this is in the auth-db configuration (see server.xml) may have an optional element <auth-expiring-url> its value must be a URL.
    When LDAP server returns LDAP_CONTROL_PWEXPIRED control, user is not authenticated in Web Server (hence will be DENIED access to resources which have ACLs that allows access only to authenticated users).
    However when LDAP server returns LDAP_CONTROL_PWEXPIRING, user is authenticated in Web Server (hence will be ALLOWED access to resources which have ACLs that allows access only to authenticated users).
    According to the documentation LDAP server should return LDAP_CONTROL_PWEXPIRED in case the use is logging in the first time
    http://www.mozilla.org/directory/csdk-docs/controls.htm#use_pwd_policy

  • Sync problem post forced reset

    Hi
    I have an ipod touch and an iphone and until wednesday they both connected to and synced with itunes and all was well.
    I then paid my £12.99 to update the touch software to 1.1.3, left everything alone and went to work; when I came home therehad been a power cut and the software had not updated propery - itunes suggestd a reset on the touch which I did and now I have nothing on the touch and itunes does not recognise the touch for syncing; it seesthe touch, ie it's listed in the devices list but the only right-click option I have is eject and the arrow to the left of the device is is missing. Thankfully, the iphone still works OK with itunes.
    All help gratefully received as I don't use the iphone as an ipod, just the touch
    Thanks in advance
    Ian

    Just in case it was the upgrade to 1.1.3 that was causing the problem i [re-]purachsed the upgrade - still makes no difference and I'll now need to check that I've only paid once for the upgrade...!
    Looking forward to answer
    Thanks
    Ian

  • How can I force reset the Airport Express?

    My Ariport Express won't reset. Airport Setup Utility for iphone 4s, ipad 3rd gen and Windows cant detect the Airport Express. It was set not to Brodcast SSID before i reset it. I tried 3 ways to reset but non of them worked. Is there other process?

    Try a Factory Default Reset as follows:
    Power off the Express
    Wait a few minutes
    Hold in the reset button on the Express first, and keep holding it in for an additional 9-10 seconds while you simultaneously plug the Express back in to power
    Release the reset button after the hold period and allow a full minute for the Express to restart to a slow, blinking amber light
    If the Express is operating correctly, it is now broadcasting a default network of Apple Network xxxxxx. You must first log on to this network....no password is required.....and then open AirPort Utility to configure the Exress with new settings.
    If you try the default reset a few times with no luck, unfortunately this is likely an indication that the Express is defective, and will need to be replaced. Take the Express to an Apple Store or Apple Servicer to have them take a look at the Express to verify.

  • IPod Keeps Forcing Reset

    Every time I either shut down my iPod Touch or put it in sleep mode and wait a few minutes, it locks itself into no mans land and requires that I reset it by holding the power and home buttons. This started happening out of the blue without upgrading any firmware or anything.
    I'm guessing my only solution is to restore off a backup of the iPod? Any other ideas?

    I am having the same problem, my ipod worked just 2 days and started rebooting over and over again, I even tried to start the ipod as an external drive but it keep rebooting no matter what I do.
    I checked this support page and realized that this seems to be happening a lot.
    is there any systemic troubleshooting process to deal with this?
    thx

  • ORA-32102 invalid OCI handle

    We are using the oracle::occi::Timestamp data type to format a timestamp. To create the Timestamp we need to call createEnvironment. We then want to clean up and terminateEnvironment, otherwise we leak memory. I'm receiving an ORA-32102 error and I'm not sure why. Has any one had experience with this? I'm calling timestamp.setNull() before calling terminateEnvironment(env). I am not creating any connections, statements, etc, just a Timestamp.

    can you post the sample code?

  • My iPod touch4th generation touch screen is not responding at all I can't slide to unlock or power off  please help I have restored it and done a force reset and every thing an I can not take it to apple due to my warranty is up

    Help me please

    HI
    try conneting it to itunes and restore it .that might help.it that doesnt call apple support and ask tem to help or just goto the apple store nearest. A good place for repairment is bestbuy geeksquad...and r u sure your warranty is up check again ...
    hope this helped

  • Please help!! ipad is disabled and will not do a hard reset to go into recovery mode.

    i cannot do a force reset... When i hold in the home and sleep/wake button nothing happens, I have tried these same steps over and over again. Neither the apple or the itunes logo ever pop up.. The screen just stays black. I recently replaced the digitizer after my son cracked the screen. I have made sure that nothing was injured during repair. I did put the digitizer ribbon in wrong and then the screen was not working correctly. I had put the ribbon in backwards. So after the first wrong installation of the digitizer, i tried to unlock the screen with my passcode but it obviously wasn't working.. i would touch the number for the passcode but the screen would respond somewhere else..so i kept getting the passcode wrong and then BAM! Ipad disabled.. so i took a break from the frustration... When i returned to my ipad i took it back apart and thats when i realized that i had the digitizer ribbon in backwards, so i fixed it and replaced the screen once again.. But now the ipad is disabled, and for some reason it will not respond when i try to shut it down all the way, no red slider at all...so i bout a apple data transfer cable and i tried to connect it to itunes and hold the buttons like i read to do in the article, and my computer recognizes that my ipad is there,,, it tells me that i have to allow access and to respond on my ipad.. but sadly i cannot.. nothing appears on the ipad.. it stays a black screen and then when i lt go the "ipad is disabled" screen comes on.....
    Then i read online that i could restore from icloud.com, so i go there, i sign in just fine but my ipad is not listed in the devices there either... it says " No Devices, You must be signed into iOS8 settings or Mac OS Yosemite system preferences to see devices."
    And i dont believe the ipad is up to date, it had been unused for about 2 months, until last week when i attempted to fix it so im sure the operating system is old :-(
    So im totally lost, I dont have a clue what to do to get my device recognized. I would really appreciate any help that anyone can give,, Thank you so much in advance!!!
    Ipad 2 wifi 16gb

    If recovery mode does not work try DFU mode.
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings

Maybe you are looking for

  • Tax code problem

    We are using Taxinj tax procedure with different tax codes as per the sale tax like VAT 4 % and VAT 12.5 % ,CST etc. Now somebody has made the changes in % of sale tax in JIN6 in existing tax code and save it.Then craete the sales order with that tax

  • Need to restore but do not have a restore point or recovery partition.

    Hi guys. I have an HP Notebook 2000-365DX with Windows 7 Home Premium.   Its so cluttered and I need to restore back to original settings.  I had installed Ubuntu (partitioned)  a while back and was very stupid because I deleted my HP Tools recovery

  • How to extract data from info cube into an internal table using ABAP code

    HI Can Anyone plz suggest me How to extract data from info cube into an internal table using ABAP code like BAPI's or function modules. Thankx in advance regds AJAY

  • SD CARD DROID INCREDIBLE

    When I save say a wallpaper it says saved to SD Card om baclground directory.  My question is, how do I retrieve stuff off the card?  When I go to my wallpaper it does not show whats on the SD Card?

  • Sound Distortion

    I am having trouble with my G5 dual processor powermac. I am getting a fuzzy distortion in all audio outputs, external and internal, when I am in my main user profile. I have run disk first aid, restarted, replaced as many audio preferences in my hom