Handling of connection closures, best practice

Hello,
I have the following situation (within some old code):
Quite a lot of different values are stores in a ldap server and are fetched often from a long-running program. There are many child-contexts from the initialcontext. The two possiblities I see are:
a) have one connection which handles all. Problem: When the connection is closed (by a ldap server restart or whatever) i have to reinitialise the initialcontext and all child contexts.
b) i use connection pooling and use a new(pooled) connection for each query.
Are the above assumtions correct? What would be the best practice to do this? Can Connection Request Controls help me with this?
I'm quite new to the advanced things of JNDI and thank you in advance for your answers.
cheers,
Michael

Yes, java.sql.SQLException is designed for that. It has two methods, getSQLState and getErrorCode, that will help you get the state of the RDBMS if something goes wrong. - MOD

Similar Messages

  • Error while Connecting report Best Practices v1.31 with SAP

    Hello experts,
    I'm facing an issue while trying to connect some of my reports from Best Practices for BI with SAP.
    It only happens when it's about info sets, the other ones that are with SAP tables go smoothly without a problem.
    The most interesting is I have already one of the reports connected to SAP info sets.
    I have already verified the document of steps of creation of additional database that comes with BP pack. They seem ok.
    Here goes what Crystal Reports throws to me after changing the data source to SAP:
    For report "GL Statement" one of the Financial Analysis one which uses InfoSet: /KYK/IS_FIGL_I3:
    - Failed to retrieve data from the database; - click ok then...
    - Database connector error: It wasn't indicated any variant for exercise (something like this after translating) - click ok then
    - Database connector error: RFC_INVALID_HANDLE
    For report "Cost Analysis: Planned vs. Actual Order Costs" one of the Financial Analysis one which uses InfoSet: ZBPBI131_INFO_ODVR and ZBPBI131_INFO_COAS; and also the Query CO_OM_OP_20_Q1:
    - Failed to retrieve data from the database; - click ok then...
    - Database connector error: check class for selections raised errors - click ok then
    - Database connector error: RFC_INVALID_HANDLE
    Obs.: Those "Z" infosets are already created in SAP environment.
    The one that works fine is one of the Purchasing Analysis reports:
    - Purchasing Group Analysis -> InfoSet: /KYK/IS_MCE1
    I'm kind of lost to solve this, because I'm not sure if it can be in the SAP JCO or some parameter that was done wrongly in SAP and I have already check possible solutions for both.
    Thanks in advance,
    Carlos Henrique Matos da Silva - SAP BusinessObjects BI - Brazil.

    I re-checked step 3.2.3 - Uploading Crystal User Roles (transaction PFCG) - of the manual where it talks about CRYSTAL_ENTITLEMENT and CRYSTAL_DESIGNER roles, I noticed in the Authorizations tab that the status was saying it hadn't been generated and I had a yellow sign, so then that was what I did (I generated) as it says in the manual.
    Both statuses are now saying "Authorization profile is generated" and the sign is now green on the tab.
    I had another issue in the User tab (it was yellow as Authorizations one before generating)....all I needed to do to change to green was comparing user (User Comparison button).
    After all that, I tried once more to refresh the Crystal report and I still have the error messages being thrown.
    There's one more issue in one of the tabs of PFCG transaction, it is on the Menu one where it is with a red sign, but there's nothing talking about it in the manual. I just have a folder called "Role menu" without anything in it.
    Can it be the reason why I'm facing errors when connecting the report to SAP infoSets? (remember one of my reports which is connected to an infoSet works good)
    Thanks in advance,
    Carlos Henrique Matos da Silva - SAP BusinessObjects BI - Brazil.

  • BI7.0 Connectivity -SAP Best Practice

    Hello,
    I need SAP Best Practices documentation on  how to connect(RFC)  ECC 6.0 and BI 7.0 blog or whitepaper.
    I have old version BW 3.5 and R/3 document RFC connect.
    Thanks

    Hi,
    Check these.
    Connection between Source Systems and BW
    http://help.sap.com/saphelp_nw70/helpdata/en/00/dc54384ac9a81be10000009b38f8cf/frameset.htm
    Creating SAP Source Systems
    http://help.sap.com/saphelp_nw70/helpdata/en/ac/4a4e38493e4774e10000009b38f889/frameset.htm
    BW connectivity(.doc)
    http://help.sap.com/bp_biv335/BI_EN/BBLibrary/documentation/B84_BB_ConfigGuide_EN_DE.doc
    Regards.

  • Connection/Connection Pooling - Best Practices

    Hi everyone,
    I'm doing my first JDBC application, and I have some questions about the right way to do things. We've got a series of business objects with lots of database abstraction and everything, and the situation comes up where we're making a lot of calls to the database to populate our objects. The high number of calls occur because of the level of abstraction we need, so when we get a Person object, we don't do a join on the address table and the phone table, but instead make seperate calls to those tables. Aside from the fact that this may not be the best way to do things, what is the best way to manage the connections? It's pretty costly time-wise to create a bunch of new connections, so I was just using one connection and passing it through our database call objects, so I'd created a connection to the DB, get my Person information, pass that connection on to read from the Address table, then again to Phone table. I know this can't be good, but it's a lot faster than creating a new connection every time. Also, I don't know how reusing the connection for different things is screwing up the cursor, or causing the application to hang until the connection is free again.
    I've read some stuff about connection pooling with JDBC 2.0, but the need for the JINI calls is confusing to me.
    Can someone take a few minutes to describe the right way to get this to work with Java? I'm using the MSSQL JDBC driver availiable on Microsoft's site, but I didn't notice which version of JDBC it supports. It's Type 4 driver, but I don't know what that means either.
    Thanks in advance,
    Jim

    They're not JINI calls, they're JNDI calls - Java Naming and Directory Interface. They're just doing a lookup to get the data source from the connection pool.
    When you see it done that way, it's usually a container like Tomcat or WebLogic that's handling the connection pool for you. Are you using either of those, or were you going to try to write your own pooling mechanism?
    Type 4 driver means it's 100% pure Java, no native code. You can read all the different types at:
    http://java.sun.com/products/jdbc/driverdesc.html
    There's another driver at SourceForge jTDS for M$ SQL Server that's pretty good. I've used it with some success, switching away from the M$ implementation:
    http://jtds.sourceforge.net/
    Good luck. - MOD

  • Handling units management SAP Best Practices Document Links

    Hi Friends
    I would like know more about handling units management .
    Could you please send me  SAP Best Practices Document handling units management Links .
    Thanks in Advance.
    Thanks
    SR

    Might be useful:
    [Click here|help.sap.com/bp_bblibrary/500/documentation/U43_BB_ConfigGuide_EN_IN.doc|weblink]
    Thanks and Regards,
    Naveen Dasari.

  • How to connect AS400 (best practice)

    Hi folks,
    I'm trying to connect to an AS400 server and need expert advise to do so.
    I'm planning to use a JDBC driver to connect to the DB2400 database (for write/read into specific tables).
    What is the best way to reset AS400 user/password ? Use JDBC connectio and write into correct table or use Windows programs as RMTCMD to connect to AS400 and then launch AS400 command line ?
    Does any of you have try these kind of solution ?
    Thanks for your help,
    Ben

    Ben,
    That's an interesting question.  I think there are a couple of approaches to this:
    1. Check with SAP to see if they have an "official" connector.  I know there was a slide deck out there a couple of years ago with some "approved" connectors.  There might be one there.  Slim chance, but why re-invent the wheel?
    2. More likely you'll need to create your own.  You're on the right path with the JDBC connector, but I'm not sure if you'll be able to set passwords.  It'll depend on the system and level of access you have.  You should also look to see if there's an LDAP interface to the system.  Might not be helpful for database applications, but would be good for general system (OS) access.
    Good luck!
    Matt

  • [XI 3.1] BEST PRACTICE method of Oracle connection for RPTs on Linux

    Business Objects XI (3.1) - SP3.
    Running on Red Hat Enterprise Linux OS.
    7,000+ Crystal Reports 2008 *.rpt objects ONLY (No Universe / No WebI).
    All reports connecting to Oracle 10g databases.
    ==================
    In the past, all of this infrastructure was running on Windows Server OS and providing the database access via a Named ODBC connection (eg. "APP_DATA".)
    This made it easy to manage as all the Report Developers had a standard System DSN called "APP_DATA" which was the same as the System DSN name on all of our DEV, TEST/UAT, and PROD servers for Business Objects.
    When we wanted to move/promote a *.rpt file from DEV to PROD we did not have to change any "Database Connection" info as it was all taken care of by pointing the System DSN called "APP_DATA" a a different physical Oracle server at the ODBC level.
    Now, that hardware is moving from Windows OS to Red Hat Linux and we are trying to determine the Best Practices (and Pros/Cons) of using one of the three methods below to access the Oracle database for our *.rpts....
    1.) Oracle Native connection
    2.) ODBC connection
    3.) JDBC connection
    Here's what we have determined so far -
    1a.) Oracle Native connection should be the most efficient method of passing SQL-query to the DB with the fewest issues and best speed [PRO]
    1b.) Oracle Native connection may not be supported on Linux - http://www.forumtopics.com/busobj/viewtopic.php?t=118770&view=previous&sid=9cca754b468fc67888ab2553c0fbe448 [CON]
    1c.) Using Oracle Native would require special-handling on the *.rpts at either the source-file or the CMC level to change them from DEV -> TEST -> PROD connection. This would result in a lot more Developer / Admin overhead than they are currently used to. [CON]
    2a.) A 3rd-Party Linux ODBC option may be available from EasySoft - http://www.easysoft.com/products/data_access/odbc_oracle_driver/index.html - which would allow us to use a similar Developer / Admin overhead to what we are used to. [PRO]
    2b.) Adding a 3rd-Party Vendor into the mix may lead to support issues is we have problems with results or speeds of our queries. [CON]
    3a.) JDBC appears to be the "defacto standard" when running Oracle SQL queries from Linux. [PRO]
    3b.) There may be issues with results or speeds of our queries when using JDBC. [CON]
    3c.) Using JDBC requires the explicit-IP of the Oracle server to be defined for each connection. This would require special-handling on the *.rpts at either the source-file (and NOT the CMC level) to change them from DEV -> TEST -> PROD connection. This would result in a lot more Developer / Admin overhead than they are currently used to. [CON]
    ==================
    We would appreciate some advice from anyone who has been down this road before.
    What were your Best Practices?
    What can you add to the Pros and Cons listed above?
    How do we find the "sweet spot" between quality/performance/speed of reports and easy-overhead for the Admins and Developers?
    As always, thanks in advance for your comments.

    Hi,
    I just saw this article and I would like to add some infos.
    First you can quite easely reproduce the same way of working with the odbc entries by playing with the oracle name resolution on the server. By changing some files (sqlnet, tnsnames.ora,..) you can define a different oracle server for a specific name that will be the same accross all environments.
    Database name will be resolved differently regarding to the environment and therefore will access a different database.
    Second option is the possibility to change the connection in .rpt files by an automated way like the schedule manager. This tool is a additional web application to deploy that can change the connection settings of rpt reports on thousands of reports in a few clicks. you can find it here :
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80af7965-8bdf-2b10-fa94-bb21833f3db8
    The last option is to do it with a small sdk script, for this purpose, a few lines of codes can change all the reports in a row.
    After some implementations on linux to oracle database I would prefer also the native connection. ODBC and JDBC are deprecated ways to connect to database. You can use DATADIRECT connectors that are quite good but for volumes you will see the difference.

  • How to handle multiple site to site IPsec vpn on ASA, any best practice to to manage multiple ipsec vpn configrations

    how to handle multiple site to site IPsec vpn on ASA, any best practice to to manage multiple ipsec vpn configurations
    before ver 8.3 and after version 8.3 ...8.4.. 9 versions..

    Hi,
    To my understanding you should be able to attach the same cryptomap to the other "outside" interface or perhaps alternatively create a new crypto map that you attach only to your new "outside" interface.
    Also I think you will probably need to route the remote peer ip of the VPN connection towards the gateway IP address of that new "outside" and also the remote network found behind the VPN connection.
    If you attempt to use VPN Client connection instead of L2L VPN connection with the new "outside" interface then you will run into routing problems as naturally you can have 2 default routes active at the sametime (default route would be required on the new "outside" interface if VPN Client was used since you DONT KNOW where the VPN Clients are connecting to your ASA)
    Hope this helps
    - Jouni

  • How to establish the connection - Best Practice

    Following is my code for database connection
    import java.sql.Connection;
    import java.sql.DriverManager;
    import oracle.jdbc.driver.OracleDriver;
    public class DBConnect
         private static Connection connection = null;
         static
              try
                   DriverManager.registerDriver( new OracleDriver() );
                   String url = "jdbc:oracle:thin:@dbserver:1521:ORCL";
                   connection = DriverManager.getConnection( url, "user", "password" );
              catch ( Exception e )
         private DBConnect()
         public static synchronized Connection getConnection()
              return connection;
    }Tell me the Best Practice to establish the connection.
    Edited by: shashiwagh on Feb 1, 2010 11:25 AM
    Edited by: shashiwagh on Feb 1, 2010 11:26 AM

    First, handle your exceptions properly.
    Second, you should not normally create static database connections.
    Third, hardcoding connection data like that is not a good idea.

  • BEST PRACTICES FOR CREATING DISCOVERER DATABASE CONNECTION -PUBLIC VS. PRIV

    I have enabled SSO for Discoverer. So when you browse to http://host:port/discoverer/viewer you get prompted for your SSO
    username/password. I have enabled users to create their own private
    connections. I log in as portal and created a private connection. I then from
    Oracle Portal create a portlet and add a discoverer worksheet using the private
    connection that I created as the portal user. This works fine...users access
    the portal they can see the worksheet. When they click the analyze link, the
    users are prompted to enter a password for the private connection. The
    following message is displayed:
    The item you are requesting requires you to enter a password. This could occur because this is a private connection or
    because the public connection password was invalid. Please enter the correct
    password now to continue.
    I originally created a public connection...and then follow the same steps from Oracle portal to create the portlet and display the
    worksheet. Worksheet is displayed properly from Portal, when users click the
    analyze link they are taken to Discoverer Viewer without having to enter a
    password. The problem with this is that when a user browses to
    http://host:port/discoverer/viewer they enter their SSO information and then
    any user with an SSO account can see the public connection...very insecure!
    When private connections are used, no connection information is displayed to
    SSO users when logging into Discoverer Viewer.
    For the very first step, when editing the Worksheet portlet from Portal, I enter the following for Database
    Connections:
    Publisher: I choose either the private or public connection that I created
    Users Logged In: Display same data to all users using connection (Publisher's Connection)
    Users Not Logged In: Do no display data
    My question is what are the best practices for creating Discoverer Database
    Connections.
    Is there a way to create a public connection, but not display it in at http://host:port/discoverer/viewer?
    Can I restrict access to http://host:port/discoverer/viewer to specific SSO users?
    So overall, I want roughly 40 users to have access to my Portal Page Group. I then want to
    display portlets with Discoverer worksheets. Certain worksheets I want to have
    the ability to display the analyze link. When the SSO user clicks on this they
    will be taken to Discoverer Viewer and prompted for no logon information. All
    SSO users will see the same data...there is no need to restrict access based on
    SSO username...1 database user will be set up in either the public or private
    connection.

    You can make it happen by creating a private connection for 40 users by capi script and when creating portlet select 2nd option in Users Logged in section. In this the portlet uses there own private connection every time user logs in.
    So that it won't ask for password.
    Another thing is there is an option of entering password or not in ASC in discoverer section, if your version 10.1.2.2. Let me know if you need more information
    thnaks
    kiran

  • What are the best practices to connect 30-40 iPads to Wi-Fi in a single room?

    What are the best practices to connect 30-40 iPads to Wi-Fi in a single room?

    I don't use it but it does say this in the help section...

  • External connectivity best practice

    Hi,
    I would like to know what are the best practices to have external users using Excel to connect to SSAS cube. I understand the general concept that a cube user must be in a domain AD andthat same user is a member of a SSAS cube.
    How can I ensure the excel connection is secure and each external user is only able to view their own data? I know the workbook can be password protected but can the connection be also password protected ?
    BTW, I am not sure if this is the right forum for this question
    Regards

    Most modern external drives will typically go into a standby mode shortly after they're unmounted or disconnected which will spin down the drive. They'll still use some power, but your drive won't be doing anything so you don't need to worry about wearing it out. I'm a bit anal about stuff. I usually go so far as to unplug my external drives when I'm not using them as the power supply still consumes some juice... but, in your case, as it seems like you probably go back and forth quite a bit... just powering it down would be the best thing. It really doesn't take any extra effort when connecting your MacBook Pro to just switch it back on again.

  • Best practice on handling a datacontrol based on a changing webservice

    Is there any best practice on how to handle changes to a datacontrol, when a webservice changes ?, it seems the information on
    portnumbers, servernames etc. is placed in a number of files, an optimal solution seems to be that Jdeveloper would have functionality
    to regenerate all relevant files based on changes to the WSDL, but this does not seem to be supported in Jdeveloper 11g
    Regards
    Ole Spielberg

    Hi,
    I think in this case you would better use a WS proxy, wrap this in a POJO and create a data control from this. This allows you to set the port and host programmatically. I agree that there should be a better option to do the same in the WS data control
    Frank

  • Best Practice - WAP connecting switchport configuration.

    Is there a best practice for deploying the WAP's in a WAP/WLC infrastructure?  Should the connecting switchport be an Access port or a Trunk port?  I've seen this implemented in both fashions and wasn't sure if one was a better choice than the order.  What is the difference?
    My other question is regarding applying additional switchport configurations.  Is there anything wrong with applying either spanning-tree portfast, spanning-tree bpdguard, or switchport port-security. 

    Hi Ken,
    Access port all the time, everywhere, UNLESS the AP is configured for HREAP/FLEX then trunk. Or if you deploy a AP in monitor mode then TRUNK.
    QOS -- if its access port trust dscp. If you truck trust cos.
    No you are fine. Portfast is highly recommended.
    "Satisfaction does not come from knowing the solution, it comes from knowing why." - Rosalind Franklin
    ‎"I'm in a serious relationship with my Wi-Fi. You could say we have a connection."

  • Best practice for handling errors in EOIO processing on AEX?

    Hi,
    I'm looing for resources and information describing the best practice on how to handle processing errors of asynchronous integrations with Exactly-Once-In-Order QoS on an AEX (7.31) Java only installation. Most information I've found so far are describing a the monitoring and restart jobs on AS ABAP.
    Situation to solve:
    multiple different SOAP messages are integrated using one queue with an RFC receiver. On error the message status is set to Holding and all following messages are Waiting. Currently I need to manually watch over the processing, delete the message with status holding and restart the waiting ones.
    Seems like I can setup component based message alerting to trigger an email or whatever alert. I still need to decide on how to handle the error and resolve it (ie. delete the errornous message, correct the data at sender and trigger another update). I still need to manually find the oldest entry with status waiting and restart it. I've found a restart job in Background jobs in configuration and monitoring home, but it can be only scheduled in intervals of 1 or more hours.
    Is there something better?
    Thank you.
    Best regards,
    Nikolaus

    Hi Nikolaus -
    AFAIK - For EOIO, you have to cancel the failed message and then process the next message in the sequence manually..
    Restart job only works the messages which are in error state but not in holding state.. So you have to manually push the message... So there is no other alternative.
    But it should not be that difficult to identify the messages in a sequence..
    How to deal with stuck EOIO messages in the XI ... | SCN
    Though it is for older version, it should be the same.. you should be able to select the additional columns such as sequence ID from the settings..

Maybe you are looking for