Cleaning up after a call to OCIAttrGet

In the code below, I call OCIAttrGet to get a session handle from the Service
Context handle svchp. After I am done with the session handle in sh_ptr, I think
I should do something to clean it up as it looks like something gets allocated.
That being said, I don't think I should call OCIHandleFree on it as it ultimately
points to a handle that is the responsibility of the service context.
Should I do something else to clean this up?
Here is the code:
// Set an application context via OCI calls.
// Extract the session handle into sh_ptr.
OCISession *sh_ptr = 0;
ub4 sh_size;
sword OCIAttrGetStatus = OCIAttrGet ( svchp,
OCI_HTYPE_SVCCTX,
&sh_ptr,
&sh_size,
OCI_ATTR_SESSION,
errhp );
// Should I free sh_ptr with OCIHandleFree?? Boil on this. While ultimately,
// sh_ptr points to a session handle that exists and is owned by something else,
// something is allocated to hold that pointer.
// Using the session handle, set the responsibility variable to the value
// manager.
sword err = OCIAppCtxSet((void *) sh_ptr,(void *)"CLIENTCONTEXT",(ub4) 13,
(void *)"responsibility", 14,
(void *)"manager", 7, errhp, OCI_DEFAULT);
Thanks for any advice . . .
Karl

Hi Karl,
You need not bother about freeing the session handle(sh_ptr) which resides inside the service context handle. Infact one should not do it since the user handle is used internally. When you do OCISessionEnd (in case of non pooled session) the service context handle will be freed up which will also result in freeing up of all the dependent handles (user handle being one of them). In case of pooled sessions the service context handle will be freed up when the session pool is destroyed.
Thanks,
Sumit

Similar Messages

  • ORB does not perform clean up after destroy() is called.

    hi,
    the HelloClient example (POA model) which is provided in the Java IDL tutorials, does not perform clean up after the execution is complete.
    i.e. i can still find the Socket descriptors in the file system under the path (/proc/p_id/fd). Do we need to explicitly destroy the sockets inorder to perform the required clean up??the OS i'm using is Linux.
    if yes, then how do i do that.... the following are the steps to reproduce the problem:
    1)start HelloServer
    2)start HelloClient
    3)check file count in /proc/process_id/fd before calling init.
    4)invoke ORB.destroy() method.
    5)check file count in /proc/process-id/fd after destroy completes.I have included Thread.sleep(25000) inorder to check the file count dynamically at each stage of execution.
    Any help in this regard is welcome....!!
    thanks in advance

    Hello:
    This reply may be long after the time that you need it ... but the problem
    that you are experiencing sounds very much like a bug that was fixed in the J2SE 1.5.0_10 release.
    It is bug 6354718 ....
    In the evaluation section of that bug they note:
    Yes. It's a known bug in ORB connection management. What's happening here is, the connectionCache that maintains both inbound and outbound connections does not reclaim connections, upon ORB destroy() call. There is a connection reclaim() logic in place, but does not kick in, until it reaches certain watermark levels. Since, a single client can have a multiple ORBs and thereby multiple outbound connections (in the reported case) , with each cache having exactly one connection which leaks up on ORB exit. This leak multiplies based on the number of ORBs and time period over which client stays live, up and running.
    The solution is, to walk through the connection cache and close each connection,
    no matter what the watermark levels are. This can be done at the corba transport manager close() call.
    Note: In the above evaluation they tell you how to fix it yourself but I believe (I haven't tested it yet ....) that if you upgrade to JDK 1.5.0_10, you should find that it has been fixed for you.
    I hope that I'm not steering you wrong, but that's my take on your situation.
    John

  • LOG_FILE_NOT_FOUND when running cleaner manually after some data purge

    I hit LOG_FILE_NOT_FOUND error when running cleaner manually after some data purge, I searched the forum, found someone also faced the same issue before, but cannot find any clue on how to fix it. Below is the error trace and followed by our configurations
    Caused by: com.sleepycat.je.EnvironmentFailureException: (JE 4.1.6)
    Environment must be closed, caused by:
    com.sleepycat.je.EnvironmentFailureException: Environment invalid because of
    previous exception: (JE 4.1.6) /scratch/tie/thirdeye/index/data-store
    fetchTarget of 0x50f/0x3fb9dd6 parent IN=368491717 IN
    class=com.sleepycat.je.tree.IN lastFullVersion=0x510/0x2ca7d18
    parent.getDirty()=false state=0 LOG_FILE_NOT_FOUND: Log file missing, log is
    likely invalid. Environment is invalid and must be closed.
    at
    com.sleepycat.je.EnvironmentFailureException.wrapSelf(EnvironmentFailureExcept
    ion.java:196)
    at
    com.sleepycat.je.dbi.EnvironmentImpl.checkIfInvalid(EnvironmentImpl.java:1439)
    at com.sleepycat.je.Environment.checkEnv(Environment.java:2117)
    at com.sleepycat.je.Environment.checkpoint(Environment.java:1440)
    at
    com.oracle.thirdeye.datastore.DataStoreManager.clean(DataStoreManager.java:402
    at
    com.oracle.thirdeye.infostore.InfoStoreManager.clean(InfoStoreManager.java:301
    ... 11 more
    Caused by: com.sleepycat.je.EnvironmentFailureException: Environment invalid
    because of previous exception: (JE 4.1.10)
    /scratch/tie/thirdeye/index/data-store fetchTarget of 0x50f/0x3fb9dd6 parent
    IN=368491717 IN class=com.sleepycat.je.tree.IN
    lastFullVersion=0x510/0x2ca7d18 parent.getDirty()=false state=0
    LOG_FILE_NOT_FOUND: Log file missing, log is likely invalid. Environment is
    invalid and must be closed.
    at com.sleepycat.je.tree.IN.fetchTarget(IN.java:1332)
    at com.sleepycat.je.tree.IN.findParent(IN.java:2886)
    at com.sleepycat.je.tree.Tree.getParentINForChildIN(Tree.java:881)
    at com.sleepycat.je.tree.Tree.getParentINForChildIN(Tree.java:809)
    at
    com.sleepycat.je.cleaner.FileProcessor.findINInTree(FileProcessor.java:1152)
    at com.sleepycat.je.cleaner.FileProcessor.processIN(FileProcessor.java:1090)
    at
    com.sleepycat.je.cleaner.FileProcessor.processFile(FileProcessor.java:538)
    at com.sleepycat.je.cleaner.FileProcessor.doClean(FileProcessor.java:241)
    at com.sleepycat.je.cleaner.Cleaner.doClean(Cleaner.java:463)
    ------------Configurations-------------------------
    EnvironmentConfig.ENV_RUN_CLEANER -> false
    EnvironmentConfig.CHECKPOINTER_HIGH_PRIORITY -> true
    EnvironmentConfig.CLEANER_EXPUNGE -> false
    Any hints are appreciated. I'm also working for Oracle CDC, feel free to call me at 861065151679 or drop me an email at [email protected] so that we can talk more in detail
    Anfernee

    Anfernee, I will contact you via email.
    --mark                                                                                                                                                                                                                   

  • TS3367 I have two IPhones and one IPad all with the same Apple ID. I can call facetime between the two IPhones, but I cannot call the IPAD from either of the IPhones and when I call my IPhone from the IPad it rings my wife's IPhone after briefly calling m

    I have two IPhones and one IPad all with the same Apple ID. I can call facetime between the two IPhones, but I cannot call the IPAD from either of the IPhones and when I call my IPhone from the IPad it rings my wife's IPhone after briefly calling mine.

    Each device needs a separate address. Use an email address (gmail.com) on the iPad.
    Using FaceTime http://support.apple.com/kb/ht4319
    Troubleshooting FaceTime http://support.apple.com/kb/TS3367
    The Complete Guide to FaceTime + iMessage: Setup, Use, and Troubleshooting
    http://tinyurl.com/a7odey8
    Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/TS4268
    Using FaceTime and iMessage behind a firewall
    http://support.apple.com/kb/HT4245
    iOS: About Messages
    http://support.apple.com/kb/HT3529
    Set up iMessage
    http://www.apple.com/ca/ios/messages/
    Troubleshooting Messages
    http://support.apple.com/kb/TS2755
    Setting Up Multiple iOS Devices for iMessage and Facetime
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
    FaceTime and iMessage not accepting Apple ID password
    http://www.ilounge.com/index.php/articles/comments/facetime-and-imessage-not-acc epting-apple-id-password/
    Unable to use FaceTime and iMessage with my apple ID
    https://discussions.apple.com/thread/4649373?tstart=90
    For non-Apple devices, check out the TextFree app https://itunes.apple.com/us/app/text-free-textfree-sms-real/id399355755?mt=8
    How to Send SMS from iPad
    http://www.iskysoft.com/apple-ipad/send-sms-from-ipad.html
     Cheers, Tom

  • How to hide or do not show the receipt's name after miss called?

    1. How to hide or do not show the receipt's name after miss called?
    2. I do not want to show my message statement in the screen.

    I have also registered to this forum to inform that the problem with showing the MAC-address in the sidebar of the finder is still not solved.
    The strange thing is that the Embedded Web Server says:
    "This specifies the Bonjour domain name assigned to the device, in the form <host name>.local. If a user-specified host name has not been assigned, the default host name HPxxxxxx is used, where xxxxxx are the last 6 digits of the LAN hardware (MAC) address. This option cannot be modified."
    But I did assign a user-specified host name and that name does show-up everywere (also within Bonjour), except in the sidebar of the finder (hp###xx##x####). Lots of people have the same issue, when searching on the interet, but not one has found the solution.
    Please help with solving this issues?

  • Sound muting problem after missed calls

    Using Skype 4.9, but confirmed with 4.7 as well.
    Android 4.2.2 JB, standard theme.
    After a missed call, my FM radio stops working, and also I find all other sounds quieter byt more than 40-50%. No volume control app helps (tried many), the volumes don't seem changed. The FM radio apparently finds stations etc. but no sound. As if it is muted, and all other sounds seem to be affected by some more master volume no app could affect.
    This whole mess is fixed when restarting the phone, or when I make another call to Sound test service (or other contact) - just establishing a call is enough to fix the issue. This is not always a solution for variety of reasons.
    Also letting skype exit (after signout) completely fixes the issue. But this "exiting" takes hours most of the time - its VideMonitor service stays for hours after signout, sometimes days. Unacceptable.
    This is Very frustrating to the point i stopped using skype until this is fixed.
    It seems Skype doesn't restore some volumes/mute after a missed call.
    The mentioned workarounds are not always viable, especially when I'm away from Wifi range. Is there another workaround, or better, a fix, when I miss a call, skype should restore sound volumes and any muted channels (fm radio).
    Thanks.

    The very same problem on Huawei Ascend G7...
    After missed call skype turns off all the sounds in the phone including alarm.
    I did late on work today because of it...
    Why nobody from the developers don't take this seriosly and to clear up that serious issue..???

  • Why wont video resume automatically after a call?

    Why is audio and video behavior different after a incoming telephone call?
    Audio will resume after a call is complete without user intervention. Why wont video.
    Why do you have to hit play after the call is completed to continue video playback?
    Its particarly annoying when you have the iPhone connected to the TV through the new video cable.
    Seems like a bug to me.

    If How to Troubleshoot iSight doesn't help, Reinstall OS X.
    Message was edited by: EZ Jim
    Mac OSX 10.9

  • Iphone hangingng after missed call

    My iphone sometimes after missed call in lock screen what is the solution knowing I wasn't face this problem in IOS 6

    Hello there, Abomosa.
    The following Knowledge Base article offers up some practical steps to try for troubleshooting issues with an application not performing as expected:
    iOS: Understanding multitasking
    http://support.apple.com/kb/ht4211
    When performing Step 2, I would recommend closing all applications that are running. If you perform Step 3 and the issue persists, you may want to try resetting as well:
    If an app doesn't respond to your input, or doesn't perform as expected, do the following, testing after each step:
    Check for app updates.
    Force the app to close.
    Restart your device.
    Update your iOS device.
    Learn more about troubleshooting apps.
    Additionally this article offers some great information for Display issues as well:
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/ts2802
    If you find the issue is still unresolved that same article offers the following:
    My issue is still not resolved. What do I do next?
    Contact Apple Support.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Call remains in "conferenced" state after the call is released

    We have a scenario where a lengthy recorded message is set up through a ICM call routing script.  If we call the number we assigned to the script using our hard phones the call is disconnected as soon as the recorded message is finished playing.
    When we use Cisco Administrator Desktop and the conference feature, the call remains in the "conferenced" state after the call has been released.
    My assumption was that our reports would be smarter than CAD and would get it right.  However, reporting agrees with CAD, it thinks the call remained on a conference call for the whole time.
    In the script we set some variables for the call, play the message through "RunExtScript" node, set a call type, than use the "ReleaseCall" node to disconnect the call. Any ideas how we can configure the script other than this?

    Hi,
    can you tell us more - do you have Translation Routing set up, perhaps?
    Also, can you take a look at the Router Log (on the Distributor server).
    And please swith the script to Monitoring mode to see where it fails.
    G.

  • Can the Icon be disposed safely after a call to Imaging.CreateBitmapSourceFromHIcon?

    Hi all,
    for a Grid that shows file paths and the associated file icon for a set of given files we extract the Icon of those files and create ImageSource instances for later use.
    Roughly:
    FileIcons aIcon = new FileIcons(filePath);
    System.Drawing.Icon i = aIcon.GetSmallIconWithTypeName(isFolder, out typeName);
    ImageSource imgSource = Imaging.CreateBitmapSourceFromHIcon(i.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
    Irrelevant but just for info: The FileIcons class uses SHGetFileInfo and ExtractIconEx of the Shell32.dll to get the Icon.
    The interesting part is: After the call to 
    Imaging.CreateBitmapSourceFromHIcon(...)
    Can I safely dispose the Icon the ImageSource was created from AND keep using the ImageSource afterwards?
    Thanks for the help,
    Frank

    Hi Frank,
    Based on your code, your case related to WPF, I would move your thread to WPF forum for better support.
    Have a nice day!
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • After update to Firefox 15 it crashes after javascript call window.close();opener.alert('test');. Is this working as intended or is it a bug?

    After update to Firefox 15 it crashes after javascript call from a popup window.close();opener.alert('test');. Is this working as intended or is it a bug?

    According to the pages linked to the crash ID, there is a bug report on this.
    Does the crash occur as soon as you run those two lines of code, or after dismissing the alert()?
    If this is your application, why are you running script commands after calling window.close()? Could you avoid the problem by using an approach like this:
    <br>window.setTimeout(function(){opener.alert('test'},250);
    window.close();

  • Anyone can prove JNI is safe? My application crashes after many calls.

    I heard that JNI is not safe. In fact I made an application base on many JNI calls.
    C level is API supplied by IBM. And I was told the C API is tested and safe.
    Java application and JNI calls is writen by myself. It crashed after about 3000 times call. I tried other JDK and other OS. On some platform, the thread hold there after many calls. No error, no crash. But others crashed even early.
    Here's my JNI call's code:
    JNIEXPORT void JNICALL Java_com_ibm_mm_sdk_cim_internal_PServiceFACImp_cEvaluate
    (JNIEnv *env, jclass jobj, jlong jhandle, jstring jmanualedListFilename, jstring jclassedListFileName, jstring jresultFilename){
         char *manualedListFilename = jstringToWindows(env, jmanualedListFilename);
         char *classedListFileName = jstringToWindows(env, jclassedListFileName);
         char *resultFilename = jstringToWindows(env, jresultFilename);
         int rc;                         // API return code
         void* handle;               // FAC Handle
         // convert C pointer from java long type
         handle = (void*)jhandle;
         rc = KmFAC_Evaluate(
              handle,                                   // FAC Handle
              (char*)manualedListFilename,     // File name of list of files
              (char*)classedListFileName,          // File name of list of files
              (char*)resultFilename               // Result file
         if (manualedListFilename)
              free(manualedListFilename);
         if (classedListFileName)
              free(classedListFileName);
         if (resultFilename)
              free(resultFilename);
         if (rc != KM_RC_OK) {
              //Throw exception
              jclass exceptClass;          // JNI exception class
              char errorMsg[256];          // Used to build error msg for exceptions
              jmethodID methodid;          // Exception constructor method id
              sprintf(errorMsg, "KmFAC_Evaluate() [CKM=%d]", (int)rc);
              exceptClass = env->FindClass("com/ibm/mm/sdk/cim/DKServiceExceptionCIM");
              methodid = env->GetMethodID(exceptClass,"<init>","(Ljava/lang/String;II)V");
              jstring str = env->NewStringUTF(errorMsg);
              jthrowable excobj = (jthrowable)env->NewObject(exceptClass,methodid,str,100, (int)rc);
              env->Throw(excobj);
         return;

    I agree with fury88. Try the code below it works fine!
    // **************** Java portion ************************
    public class Test {
    // Load the dll that exports functions callable from java
    static {System.loadLibrary("TestImp");}
    // Imported function declarations
    public native void print(String msg);
    public void Test() {
    public static void main(String [] args) {
    Test t = new Test();
    // Printf example
         t.print("->Testing JNI - Hello from c++\n");
    // **************** Windows portion - TestImp.dll **********************
    // Exported function
    JNIEXPORT void JNICALL Java_Test_print(JNIEnv *env, jobject obj, jstring msg)
    const char *str = env->GetStringUTFChars(msg, 0);
    printf("%s\n", str);
    env->ReleaseStringUTFChars(msg, str);
    // Entry point
    BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
         switch(ul_reason_for_call)
              case DLL_PROCESS_ATTACH:
                   return TRUE;
              case DLL_PROCESS_DETACH:
                   return TRUE;
    return TRUE;
    }

  • Best practices for cleaning up after a Bulk REST API v2 export

    I want to make sure that I am cleaning up after my exports (not leaving anything staging, etc). So far I am
    DELETEing $ENTITY/exports/$ID and $ENTITY/exports/$ID/data as described in the Bulk REST API documentation
    Using a dataRetentionDuration when I create an export (as a safety net in case my code crashes before deleting).
    Is there anything else I should do? Should I/can I DELETE the syncs I create (syncs are not listed in the "Delete an Entity" section of the documentation)? Or are those automatically deleted when I DELETE an export?
    Thanks!
    1086203

    Hi Chris,
    I met the same problem as pod
    It happens when I tried to load all historical activities, and one sample is same activityId was given to 2 different types (one is EmailOpen, the other is FormSubmit) that generated in year 2013
    Before full loading, I ever did testing for my job, extracting the activity records from Nov 2014, and there is not unique ID issue
    Seems Eloqua fixed this problem before Nov 2014, right?
    So if I start to load Activity generated since 2015, there will not be PK problem, or else, I have to use ActivityId + ActivityType as compound PK for historical data
    Please confirm and advise
    Waiting for your feedback
    Thanks~

  • Bad readings from DAQCard-6036E after DAQmxSelfCal() call

    Hi,
    I have a very urgent problem that I would like investigating.
    I have a DAQCard-6036E and have noticed that, occassionally, after a call to DAQmxSelfCal(), the AI readings are incorrect.
    All channels in my application are configured in differential mode, and the readings returned are occassionally wrong by ~9mV on channels with gain of 1, and ~0.9mV on channels with a gain of 10.
    If I repeatedly call DAQmxSelfCal(), I seem to get the bad readings after about every 3rd call to DAQmxSelfCal() - then the next call will usually correct the calibration coeffns, and so on. I have not been able to establish an exact pattern to the problem, but have tried with the laptop on mains power, and internal batter
    ies and the problem is the same.
    Could there be a problem with the self calibration function in DAQmx, or could there be an external influence? When I call DAQmxSelfCal() my signals are connected to the card, but I assume the inputs get isolated from connected signals during the calibration routine.
    Thanks

    Hi Ed,
    I got a loan DAQCard-6036E from NI and tried that and had the same problems. I am suspicious that it is something to do with my laptop, maybe the battery monitoring circuitry or something. Assuming that there is nothing wrong with the DAQCard 6036 internal design, my theory is that if the laptop generates noise while the self-cal is in progress then this can affect the calibration coeffns that are generated. This might be a rubbish theory, but believe me, the effect is genuine.
    I would say proceed with caution, put the self cal in, but test it thoroughly by calling it repeatedly with a high precision voltage reference attached and check the returned values. Note that I only think this is an issue with DAQCards, I have not seen it with PCI cards, but then I have not tested these as much.
    By the way, doing a self cal once per day is more than enough. Once per hour is too much. There is an article somewhere on NI.com that talks about the recommended interval. Make sure the laptop has been on for at least 15 mins first.
    Let me know how you get on.
    Regards
    Jamie

  • Q10 ring tone continues to play after missed call

    using q10.
    the ring tone continues to play after missed call. tried to change the ring tone from song to default ring tone available in the os but the problem remains the same.

    I recommend installing the official version 10.1.0.4181
    By now also tell them that these errors will be fixed in the next official update to OS 10.2 is expected to be available soon.
    My thinking about the end of October.
    Regards.
    Kudos ** Do not forget to give those people who help and advise you regarding your questions ** Can
    Accept as Solution to ** Comments **
    @gutijose14
    BBM Channels  PIN: C0007093A
    Do not forget to give LIKE    Those people who help you and advise you about your doubts.  if the review has been SOLVED** # 4LL  #ÉliteRoad  Make a backup of your BlackBerry
    BlackBerry Protect and  BlackBerry Link constantly.  #ichooseBlackBerry10 Gutijose14 Forums Veteran I

Maybe you are looking for

  • Can´t view video in viewer

    How can I display different nodes in the viewer? If I doubleclick the nodes I can view pictures but video will not show. With only one node with video it will display..

  • Hardware / PC Software to play DSP4 HD-DVD's available?

    DSP4 produces excellent HD-DVD's from HDV 1080i material. I love them. They play wonderfully on any G5 and IntelMac. But does anyone know of a current model regular/home DVD player that can play these DVD's and whether any software for Windows-based

  • Itunes slow and sputtering  --  frequent issue with many

    well so much for an update. after updating to latest itunes, 7.0.2.16, my songs and movies skip and run slow. i have tried all the fixes: new sound card driver, delete quicktime and reinstall, sound enhancer conflict, no plug ins, hardware excellerat

  • Matrix Layout in Forms

    I want to represent the query results just as the report editor would in a matrix style. How do I do it? I don't want to use the spread table facility. tks null

  • I cannot make Adobe Reader open on my laptop.

    I installed Adobe Reader XI but it would not work.  I have windows 7.  I then uninstalled it and installed X which didn't work so I tried 9.  How do I make Adobe Reader work on my laptop?  It just opens a greyed out window and then closes again.