What should be done when client.connect() failed?

Hi guys,
I am using JCO to connect backend System. If client.connect() is called and for certain reason failed, what should I do to roll back the action so that the system keeps normal. I think client.disconnect is not the solution, because connect is not successful. I encountered this problem, and my portal is totally down, what should I do to avoid this situaltion?
My code is
try{
          client.connect();
catch (JCO.Exception e){
//WHAT SHOULD BE DONE HERE?
     System.exit(1);
Thanks in advance!
Regards,
Liying

Hi,
Can you try this code.
class JCOConnector {
private JCO.Client mConnection = null;
  // loginParams will settings for connection
  public static boolean connect(Properties loginParams) {
  boolean returnCode = false;
          try {
               mConnection = JCO.createClient(loginParams);                              
               long timeBeforeConnecting = System.currentTimeMillis();
               mConnection.connect();
               long timeAfterConnection = System.currentTimeMillis();                              
               returnCode = true;
          } catch (Exception e) {
               try {
                    disconnect();
               } catch (Exception e2) {
               throw new RuntimeException(e);
          return returnCode;
      * To Disconnect from the middleware.
     public static boolean disconnect() {
          boolean returnCode = false;
          if (mConnection != null) { // if connection exists
               try {
                    mConnection.disconnect();     // disconnect from the middleware
                    returnCode = true;
               }catch (Exception e2) {
               }finally {
                    mConnection = null;               
          }else{               
               returnCode = true;
          return returnCode;     
Regards,
Ashwani

Similar Messages

  • Whenever i try and send an imessage to someone that has an iphone it gets stuck at times and won't go through. I then have to send it as a basic text and then it will respond message failed to send what should i do when it does this i need help

    Whenever i try and send an imessage to someone that has an iphone it gets stuck at times and won't go through. I then have to send it as a basic text and then it will respond message failed to send what should i do when it does this i need help

    The use of iMessage depends on both the sender and the receiver having an active data connection. If either of the two connections are interrupted, the message can fail. The sending of an iMessage differs from the sending of an SMS, and if you are having SMS failures, that would be a carrier concern.

  • When i download music from internet it is not shown in my phone's music library....what should be done to fix this?

    When i download music from internet it is not shown in my phone's music library....whenever i want to listen that music i have to open that application through which i have downloaded it. What should be done to fix this?

    you can only get music to work if
    1. it was downloaded on the itunes app in the iphone
    2. it was synced from itunes on a computer
    downloading files does not work

  • What can be done when applications and game fail to open in sonyericsson k550i?

    what can be done when applications and games fail to open in sonyericsson k550i?

    http://www.sonyericsson.com/cws/support/mobilephones/downloads/k550i?cc=gb&lc=en If this only happens with games/apps installed on the memory card but not with the ones in the phone memory, back these up on the PC and format the card.Otherwise, run the update service and failing that, try a master reset, remembering to back up your phone on PC/PC companion first.

  • TS4268 I can call facetime my contact/friend but status says "CONNECTING" but doesnt connect. what should be done to overcome/correct it. Help is appreciated.

    I can call facetime my contact/friend but status says "CONNECTING" but doesnt connect. what should be done to overcome/correct it.
    I have tried logginf off my account and sign in after restarting my iphone. But it still doesnt help !! Any suggestion/Help is appreciated. Many thanks

    Judging by all the posts on the forum, there seems to be an issue at Apple's end, although they have made no announcement on their status page. Some users have reported that Apple is aware of the issue.
    http://www.apple.com/support/systemstatus/

  • HT1212 Hello, for some reason i'Ve lost the ability to access my ipad, although i know the password, the ipad now is deactivated and telling me to connect to iTunes, i've done so but itunes can not access it anyway. Please tell me what should be done to r

    Hello, for some reason i'Ve lost the ability to access my ipad, although i know the password, the ipad now is deactivated and telling me to connect to iTunes, i've done so but itunes can not access it anyway.
    Please tell me what should be done to retrieve my photos on ipad before reformatting it.

    Unless you've done anything to change it, Google keeps every email that ever passes through their server in your All Mail folder/mailbox/label. Even if you delete stuff, they hold onto it, there. You have to go out of your way to actually delete anything permanently.

  • IPad Air with iOS 8.02 freezes and blue screen appears. What should be done ? Why is this happening ?

    IPad Air with iOS 8.02 freezes and blue screen appears. What should be done ? Why is this happening ?

    If nothing else works, you might try this one. It has worked for many others ...
    Use iTunes to do a reset to factory default condition. Always be sure to do your backups before fiddling with your iPad. You might do both the iCloud and the iTunes backup, just to be sure!
    Back up and Restore your iOS Device with iCloud or iTunes
    http://support.apple.com/kb/ht1766
    iTunes: About iOS Backups
    http://support.apple.com/kb/ht4946
    Use iTunes to Restore your iOS Device to Factory Settings
    http://support.apple.com/kb/ht1414
    Various issues from many different users have been solved by this. I've lost count on how many have been helped by this, so far. But, it doesn't mean EVERYONE will be helped, but I've seen a whole lot. You can only try and see ...
    iPad 2 and iOS 8.0.2 Problems
    For all iPad 2 owners, this is an important solution for you! These problems result from long-term use, continuous upgrades, corrupted files and various glitches that happen over this long term use. You just need to get your iPad 2 back to FACTORY FRESH CONDITION to start out clean!
    Here's one person's solution which will help a lot of iPad 2 users!
    keithfrommariettaOct 12, 2014 3:25 PM Re: IPAD2 very slow after IOS 8 upgrade
    Re: IPAD2 very slow after IOS 8 upgradein response to pacoKAS
    SOLVED:  IOS 8 Issues on iPad 2:
    I just returned home from a visit to the Genius Bar. Like you and many others, when I upgraded my iPad 2 to IOS 8, it became practically unusable. It was VERY slow, lagged whenever trying to to do anything. Lots of screen freezes and apps spontaneously crashing. I was convinced that the processor on the iPad 2 just couldn't handle the new IOS and I went in to see about restoring to IOS 7.
    Thankfully, I was hooked up with a very sharp guy at the bar. The problem is not with the OS, it is with it being an *upgraded* OS. He used the analogy of when you had an older Windows computer and how over time (and over upgrades), they just tended to get slower and slower because of all of the garbage that was carried forward in the upgrades. At those times (and if you've ever had a Windows computer, you get this), the only thing that would speed it up would be to wipe the machine and do a fresh install of the current OS and then reload your apps, and the viola, everything would be fast again. Well, it turns out that IOS can suffer the same problems.
    THE FIX:  FIRST, be sure you have a current iCloud backup of your device.  Connect your iPad to a computer that has a clean fresh copy of IOS 8 on iTunes (this is best done with a computer other than the one that you sync your device to because you DO NOT want to restore it from a back up just yet). Ideally, if you do this at an Apple store you'll be assured of the right version there and someone to answer any questions you might have along the way. You then hold the power and home button down to hard-reset the device and continue to hold them down until it reboots into recovery mode. You then follow the instructions on the computer to reinstall the OS on the device (which wipes everything from it and then reinstalls a clean copy of it). Once this is done (which only takes about 15 minutes), your device will reboot and ask you to set it up. Answer the questions about language, location, etc. and continue until it asks you to log into your iTunes account. Once you do that, it will ask if you want to either 1) Set it up as a new device, 2) Restore from iCloud, or 3) Restore from iTunes. Choose (2), restore from iCloud. This will ensure that it brings down "clean" copies of all of your apps and preferences rather than the potentially corrupted ones that might reside in your iTunes backup. That's it! It will take a few hours depending on how much data and apps you have, but I am happy to report that my iPad 2 is now running IOS 8 and it's running as fast as it ever did when it was brand new!
    To sum it up, this process 1) Wipes your device and the garbage causing your problems, 2) Loads a clean and bug-free version of IOS 8 to your device, and 3) restores your apps and data so that it looks just like it did before the wipe, with the exception that it works now!  :-)
    Note also that by following this process you don't have to go through the painful and laborious process of reloading all of your apps, data and/or settings. iCloud takes care of all of that for you.

  • What should be done to include the current controlfile in the database copy

    Hi
    When trying to create a copy of the database it always fails copying the controlfile
    What should be done to include the current controlfile in the database copy with the %b format
    RMAN> backup as copy database format 'd:\backup\%b'
    2> ;
    Starting backup at 13-SEP-10
    using channel ORA_DISK_1
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00001 name=D:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF
    output file name=D:\BACKUP\SYSTEM01.DBF tag=TAG20100913T204940 RECID=16 STAMP=729636617
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00003 name=D:\ORACLE\ORADATA\ORCL\UNDOTBS01.DBF
    output file name=D:\BACKUP\UNDOTBS01.DBF tag=TAG20100913T204940 RECID=17 STAMP=729636660
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00002 name=D:\ORACLE\ORADATA\ORCL\SYSAUX01.DBF
    output file name=D:\BACKUP\SYSAUX01.DBF tag=TAG20100913T204940 RECID=18 STAMP=729636692
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
    channel ORA_DISK_1: starting datafile copy
    *copying current *control file**
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 09/13/2010 20:51:36
    ORA-19715: invalid format b for generated name
    ORA-27302: failure occurred at: slgpn
    continuing other job steps, job failed will not be re-run
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00004 name=D:\ORACLE\ORADATA\ORCL\USERS01.DBF
    output file name=D:\BACKUP\USERS01.DBF tag=TAG20100913T204940 RECID=19 STAMP=729636697
    channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
    channel ORA_DISK_1: starting full datafile backup set
    channel ORA_DISK_1: specifying datafile(s) in backup set
    *including current SPFILE in backup set*
    channel ORA_DISK_1: starting piece 1 at 13-SEP-10
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 09/13/2010 20:51:38
    ORA-19715: invalid format b for generated name
    ORA-27302: failure occurred at: slgpnEdited by: hrishy on Sep 13, 2010 8:26 AM

    hrishy wrote:
    Allright your trick configure controlfile autobackup on does the trick but i am cluless why it worksWhy clueless? That's a documented and a perfectly normal behavior!
    http://download.oracle.com/docs/cd/E11882_01/backup.112/e10642/rcmconfb.htm#BRADV89408
    HTH
    Aman....

  • HT201210 what should i do when message say the ipad could not be restored. an unknown error occured (2003)

    what should i do when message say the ipad could not be restored. an unknown error occured (2003)

    http://support.apple.com/kb/TS3694#error3194
    Unable to contact the iOS software update server gs.apple.com
    Error 1004, 1013, 1638, 3014, 3194: These errors may be the result of the connection to gs.apple.com being redirected or blocked. Follow these steps to resolve these errors:
    Install the latest version of iTunes.
    Check security software. Ensure that communication to gs.apple.com is allowed. Follow this article for assistance with security software. iTunes for Windows: Troubleshooting security software issues.
    Check the hosts file. The restore will fail if there is an active entry to redirect gs.apple.com. Follow iTunes: Advanced iTunes Store troubleshooting to edit the hosts file or revert to a default hosts file. See section "Blocked by configuration: (Mac OS X/Windows) > Rebuild network information".
    Try to restore from another known-good computer and network.
    If the errors persist on another computer, the device may need service.

  • Pls its very urgent - i dropped by iphone 3G and the display became very dim soon after and it still remains the same - pls advise what should be done to bring the display back to normal

    Pls its very urgent - i dropped by iphone 3G and the display became very dim soon after and it still remains the same - pls advise what should be done to bring the display back to normal

    sounds like you broke the display when you dropped it.  There's nothing we users here can do for you.
    Since the iPhone warranty does not cover accidental damage, you will have to pay to have your phone repaired or replaced.  You can bring it into Apple for an out of warranty exchange in the country of purchase, or you can find a 3rd party iPhone repair store in your area.

  • TS1717 itunes won't start because it says the folder was made in newer version, what should be done?

    itunes won't start because it says the folder was made in newer version, what should be done?

    If you haven't deliberately tried to downgrade iTunes then it is possible the library is corrupt. This approach should work.
    Empty/corrupt library after upgrade/crash
    Hopefully it's not been too long since you last upgraded iTunes, in fact if you get an empty/incomplete library immediately after upgrading then with the following steps you shouldn't lose a thing or need to do any further housekeeping. In the Previous iTunes Libraries folder should be a number of dated iTunes Library files. Take the most recent of these and copy it into the iTunes folder. Rename iTunes Library.itl as iTunes Library (Corrupt).itl and then rename the restored file as iTunes Library.itl. Start iTunes. Should all be good, bar any recent additions to or deletions from your library.
    See iTunes Folder Watch for a tool to catch up with any changes since the backup file was created.
    When you get it all working make a backup!
    tt2

  • Exception while creating JCo client connection Failed to create

    Hello all -
       I am trying to create JCo metadata connections and I am getting the below error trace.
    Exception while creating JCo client connection Failed to create new JCO client connection SAP_R3_HumanResources_Metadata: com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Failed to change password for key SAP_R3_HumanResources_Metadata in secure storage at com.sap.tc.webdynpro.serverimpl.wdc.sl.SecureStorageWrapper.changePassword(SecureStorageWrapper.java:149) at com.sap.tc.webdynpro.serverimpl.wdc.sl.SystemLandscapeFactory.createJCOClientConnection(SystemLandscapeFactory.java:299) at com.sap.tc.webdynpro.services.sal.sl.api.WDSystemLandscape.createJCOClientConnection(WDSystemLandscape.java:107) at com.sap.tc.webdynpro.tools.sld.ButtonBar.onActionFinish(ButtonBar.java:265) at com.sap.tc.webdynpro.tools.sld.wdp.InternalButtonBar.wdInvokeEventHandler(InternalButtonBar.java:265) at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87) at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420) at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132) at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335) at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143) at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:321) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666) at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250) at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149) at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62) at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364) at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039) at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265) at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95) at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176) Caused by: com.sap.security.core.server.securestorage.exception.ObjectStorageException at com.sap.security.core.server.securestorage.remote.RemoteSecureStorageClientContextImpl.storeObject(RemoteSecureStorageClientContextImpl.java:600) at com.sap.tc.webdynpro.serverimpl.wdc.sl.SecureStorageWrapper.changePassword(SecureStorageWrapper.java:137) ... 33 more
    Could anybody please suggest what is wrong with this creation?
    Thanks much!!

    Hi Maria,
    Please update the host and sevice file first then check the SLD test and SLD Data supplier in visual admin.
    Also check and verify the data using in the Jco destination creation.
    Hope it will helps
    Regards
    Arun Jaiswal

  • Firefox crashes every time at the moment I enable flash plugin. I've uninstalled and installed a plugin again with no positive result. What should be done?

    Firefox crashes every time when I enable a flash plugin. It started today after an automatic attempt of updating shockwave. I've uninstalled flash and installed it again. Still the same story. There are no previous version of flash available on adobe site. What should be done?

    I have Firefox 3.6.8 and newest version of Flash. I've followed all recommendations made by Firefox support, changing plug in container settings, changing hang time, nothing helps. I'm forced to disable Adobe Flash or Firefox crashes whenever the Flash plug-in is needed. There are numerous reports of this problem throughout the Firefox troubleshoot help pages. No one seems to have a good answer to fix this. I now keep Flash disabled and use it only when going to a web page that needs it. If I find myself on such a page, I can go into tools, enable flash and do a reload. For some reason, this works. The reload will let Flash do its thing and Firefox won't have an APPCRASH. Once I leave that page, however, I must disable Flash again or I'll experience a crash the next time Flash is called upon. I really like FF but have downloaded Chrome and am now playing with it to see if I like it enough to use it as my primary browser. It's a shame that FF can't come up with a fix as hundreds have the same complaint.

  • What should i do when i forget my reset password

    What should i do when i forget my reset password??

    With 10.4, 10.5 or 10.6 put your install DVD into the optical drive (CD/DVD drive) and reboot. Be sure to either use the disc that came with your Mac, or, if you installed a later Mac OS X version from disc, use the newer disc. As soon as you hear the boot chime, hold down the "c" key on your keyboard (or the Option Key until the Install Disk shows up) until the apple shows up. That will force your MacBook to boot from the install DVD in the optical drive.
    When it does start up, you'll see a panel asking you to choose your language. Choose your language and press the Return key on your keyboard once. It will then present you with an Installation window. Completely ignore this window and click on Utilities in the top menu and scroll down to Reset Password. After resetting the password use Startup Disk from the same menu to choose your hard drive for startup and restart.
    With 10.4, 10.5 or 10.6 if you don’t have an install disk check this article. http://www.macyourself.com/2009/08/03/how-to-reset-your-mac-os-x-password-withou t-an-installer-disc/
    If you're running 10.7 Lion check this article
    http://osxdaily.com/2011/08/24/reset-mac-os-x-10-7-lion-password/
    With 10.8 or 10.9 restart holding the Command and R keys, then from the drop down
    of actions, choose Terminal.  When Terminal opens type:
    resetpassword
    and press enter.
    You will get a reset password window from which you can select the user you want to reset, the admin account in your case.  Type a new password twice, do not do anything with the hint box.  Click Save, then confirm you want to do this reset.  Then click apply to the user's home directory, and click the apple in the left corner, and choose Restart.

  • I install windows 7 on my mac pro. and participate in windows 7 to 50gb 2 disk. but now i cannot enter my mac. only windows is appearing what should i do. when try enter my mac want me to format rest of disk. how can i reinstall my mac

    i install windows 7 on my mac pro. and participate in windows 7 to 50gb 2 disk. but now i cannot enter my mac. only windows is appearing what should i do. when try enter my mac want me to format rest of the disk. how can i reinstall my mac?

    If you use Windows program to partition the Hard Drive, the Apple partition gets destroyed.
    Windows does not understand it is a guest on your Mac, and throws garabge wherever it pleases.

Maybe you are looking for

  • Lightroom - 'edit in' option no longer working

    I have LR version 5.7 and Elements 12.1. I am running a Mac with OS X Yosemite 10.10.1. When using LR the 'edit in' option used to start up Elements automatically. It no longer does this. I have checked the preferences are set correctly in LR. I have

  • Adding View/tab TO service Order Item Level

    Hi All, I am using CRM 5.0 SP3. I need to add a new View/Tab on SERVICE ORDER at Item Level Details. This view consist of Some Custom Field (like IO Box, Drop down etc.) I have created the view but not able to understand how to add this view to the I

  • How submit bug reports?

    I have a query which runs under Oracle 9i and disappears into the void under Oracle 10g (Windows OS). I suppose I can't call it a bug because I don't know if Oracle 10g simply supports a different SQL or the optimizer is very different. I can supply

  • Need help Playing/Formatting videos!!

    I have several music videos saved as Quick Time files, but my iPod is not recognizing them, or downloading them? any suggestions???

  • How to check Unissued check number for NON-Seq cheques

    Dear experts,                         i want to know the unissued cheques for non seq cheques where i issued nearly 900 from 1000 cheques in my cheque lot 1. Just i want to know the cheque number which are not issued. Thanks in advance