Keep connection opened for loop

Hello Community!
I'm using JCO to connect a Flex application to a backend SAP System.
This is how I connect to the system:
    - Edit configuration file for SAP System
    - JCoDestination dest = JCoDestinationManager.getDestination(configurationFile)
    - JCoFunction func = dest.getRepository.getFunction('myFunction')
    - func.execute(dest)
I think that the connection is established when I execute the JCoFunction and then closes inmediatly after the execution is done.
The issue I'm having is that I have a RFC FM in SAP that is really fast (at least in SAP). I'm calling this FM via the JCo in a Loop and it's taking forever.
I think that the long response time comes from the connection... But don't know how to resolve it but creating a FM that call myfunction in a Loop and the returns it to Java...
Thanks for any help you can provide.
Regards,
BS_C3

By default JCo 3 uses connection pools. You can check the connection parameters in interface DestinationDataProvider. Here you can especially check out parameters jco.destination.expiration_time and jco.destination.expiration_check_period.
So connections are reused (not closed) as long as you don't create new destination objects with each call. Note that usually there's quite some overhead with the first invocation of an RFC call if you have to retrieve the metadata from a SAP repository. I.e. if you trace the calls you'll see that initially there's quite a few calls to figure out the function module interface of the called RFC and all corresponding parameters (e.g. if structures or tables are used those have to be retrieved as well). So you can gain some performance by adding the metadata of the used functions to the repository (or usage of a JCoCustomRepository and loading for example saved metadata before executing the RFC calls).
To check performance I'd enable tracing and possibly look at some of the other options for measuring performance (e.g. check out JCoDestination.setThroughput() and other options).
Cheers, harald

Similar Messages

  • Is there a fix for Mail keeping 4 connections open for one.......?!

    Is there a fix for Mail keeping 4 connections open for one email account setup as IMAP.......?!
    Im just wondering whether this is possible because it means our company website falls over when the processes go over 25! There are a lot of emails.....
    It is a massive pain and ideally we dont want to upgrade our hosting package if we can help it!
    There must be a way round it?! Someone brainy know any tricks?!

    Ernie Stamper wrote:
    Never have encountered this -- more info, please? What are 4 connections, exactly?
    Very simple: Mail opens one connection for each IMAP mailbox on the account. Typically, this means Inbox, Sent Mail, Drafts, and Trash, but also includes Apple Mail To Do and Junk and any mailboxes/folders the user has created.
    The problem is that Mail is keeping these connections open when it's done checking for new mail, even when *Use IDLE command if server supports it* is not enabled. With 4 email accounts on one server, this causes a "500 Internal Server Error" because there are too many processes running. As soon as I quit Mail, my web server resumes serving pages.
    Message was edited by: Don Morris

  • Why does JDBC keep connections open even though I close the resultsets?

    I attached my program and my output. Please bear with me for the long output. My question here is why do the connections remain even though I closed the resultsets. I need to reuse my prepared statements, but don't want to keep the oracle sessions open. Is this possible? What do I need to do?
    If you notice in the program, I have executed the query to find the number of open sessions 5 times.
    1) After creating the connections
    2) After creating the prepared statements
    3) After executing them
    4) After getString on the resultSets
    5) After closing the resultsets.
    And the sessions are still there even is Step 5 :-(
    import java.sql.*;
    * Title:
    * Description:
    * Copyright: Copyright (c) 2001
    * Company:
    * @author
    * @version 1.0
    public class Test {
    String dburl = "jdbc:oracle:thin:@oracle92:1521:oracle92";
    String query = "select s.username,s.sid ,s.logon_time, s.serial#,sql.sql_text"+
    " from v$session s, v$sqltext sql where sql.address = "+
    "s.sql_address and sql.hash_value = s.sql_hash_value "+
    "and upper(s.username) like 'KRTEMP%'"+
    " order by s.username ,s.sid ,s.serial# ,sql.piece" ;
    // String query = "select s.username, s.sid ,s.logon_time, s.status from v$session s where upper(s.username) like 'KRTEMP%'";
    public Test(int num) throws Exception {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection[] con = new Connection[num];
    for(int i=0; i<num; i++) {
    con[i] = DriverManager.getConnection(dburl, "krtemp", "krtemp");
    executeQuery();
    PreparedStatement[] ps = new PreparedStatement[num];
    for(int i=0; i<num; i++) {
    ps[i] = con.prepareStatement("select * from contact");
    executeQuery();
    ResultSet[] rs = new ResultSet[num];
    for(int i=0; i<num; i++) {
    rs[i] = ps[i].executeQuery();
    executeQuery();
    for(int i=0; i<num; i++) {
    ResultSetMetaData meta = rs[i].getMetaData();
    while(rs[i].next()) {
    for(int j=1; j<=meta.getColumnCount(); j++) {
    rs[i].getString(j);
    executeQuery();
    for(int i=0; i<num; i++) {
    rs[i].close();
    executeQuery();
    private void executeQuery() throws Exception {
    Connection con = DriverManager.getConnection(dburl, "krtemp", "krtemp");
    PreparedStatement ps = con.prepareStatement(query);
    ResultSet rs = ps.executeQuery();
    ResultSetMetaData meta = rs.getMetaData();
    System.out.println("-----");
    while(rs.next()) {
    for(int i=1; i<=meta.getColumnCount(); i++) {
    System.out.print(rs.getString(i));
    System.out.print(" ");
    System.out.println();
    System.out.println("-----");
    public static void main(String[] args) throws Exception {
    Test test = new Test(5);
    The output is
    KRTEMP 9 2005-06-27 17:09:30.0 5436 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS WH
    ERE PARAMETER ='NLS_
    KRTEMP 9 2005-06-27 17:09:30.0 5436 DATE_FORMAT'
    KRTEMP 34 2005-06-26 18:51:01.0 3629 rename tstore to store
    KRTEMP 37 2005-06-27 17:09:25.0 4209 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS W
    HERE PARAMETER ='NLS_
    KRTEMP 37 2005-06-27 17:09:25.0 4209 DATE_FORMAT'
    KRTEMP 74 2005-06-27 17:09:26.0 17625 select appId from profile_application_tabl
    e wher
    KRTEMP 74 2005-06-27 17:09:26.0 17625 e appName=:1 and appVersion=:2
    KRTEMP 83 2005-06-27 17:09:25.0 1771 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS W
    HERE PARAMETER ='NLS_
    KRTEMP 83 2005-06-27 17:09:25.0 1771 DATE_FORMAT'
    KRTEMP 105 2005-06-27 17:09:30.0 3296 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS
    WHERE PARAMETER ='NLS_
    KRTEMP 105 2005-06-27 17:09:30.0 3296 DATE_FORMAT'
    KRTEMP 111 2005-06-27 17:09:25.0 4878 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS
    WHERE PARAMETER ='NLS_
    KRTEMP 111 2005-06-27 17:09:25.0 4878 DATE_FORMAT'
    KRTEMP 153 2005-06-27 17:09:30.0 31065 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS
    WHERE PARAMETER ='NLS_
    KRTEMP 153 2005-06-27 17:09:30.0 31065 DATE_FORMAT'
    KRTEMP 163 2005-06-27 17:09:30.0 3205 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS
    WHERE PARAMETER ='NLS_
    KRTEMP 163 2005-06-27 17:09:30.0 3205 DATE_FORMAT'
    KRTEMP 183 2005-06-27 17:09:30.0 3465 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS
    WHERE PARAMETER ='NLS_
    KRTEMP 183 2005-06-27 17:09:30.0 3465 DATE_FORMAT'
    KRTEMP 191 2005-06-27 17:09:26.0 5438 select appId from profile_application_tabl
    e wher
    KRTEMP 191 2005-06-27 17:09:26.0 5438 e appName=:1 and appVersion=:2
    KRTEMP 256 2005-06-27 17:09:30.0 2718 select s.username,s.sid ,s.logon_time, s.s
    erial#,sql.sql_text fr
    KRTEMP 256 2005-06-27 17:09:30.0 2718 om v$session s, v$sqltext sql where sql.ad
    dress = s.sql_address
    KRTEMP 256 2005-06-27 17:09:30.0 2718 and sql.hash_value = s.sql_hash_value and
    upper(s.username) like
    KRTEMP 256 2005-06-27 17:09:30.0 2718 'KRTEMP%' order by s.username ,s.sid ,s.s
    erial# ,sql.piece
    KRTEMP 9 2005-06-27 17:09:30.0 5436 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS WH
    ERE PARAMETER ='NLS_
    KRTEMP 9 2005-06-27 17:09:30.0 5436 DATE_FORMAT'
    KRTEMP 34 2005-06-26 18:51:01.0 3629 rename tstore to store
    KRTEMP 37 2005-06-27 17:09:25.0 4209 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS W
    HERE PARAMETER ='NLS_
    KRTEMP 37 2005-06-27 17:09:25.0 4209 DATE_FORMAT'
    KRTEMP 74 2005-06-27 17:09:26.0 17625 select appId from profile_application_tabl
    e wher
    KRTEMP 74 2005-06-27 17:09:26.0 17625 e appName=:1 and appVersion=:2
    KRTEMP 83 2005-06-27 17:09:25.0 1771 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS W
    HERE PARAMETER ='NLS_
    KRTEMP 83 2005-06-27 17:09:25.0 1771 DATE_FORMAT'
    KRTEMP 105 2005-06-27 17:09:30.0 3296 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS
    WHERE PARAMETER ='NLS_
    KRTEMP 105 2005-06-27 17:09:30.0 3296 DATE_FORMAT'
    KRTEMP 111 2005-06-27 17:09:25.0 4878 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS
    WHERE PARAMETER ='NLS_
    KRTEMP 111 2005-06-27 17:09:25.0 4878 DATE_FORMAT'
    KRTEMP 153 2005-06-27 17:09:30.0 31065 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS
    WHERE PARAMETER ='NLS_
    KRTEMP 153 2005-06-27 17:09:30.0 31065 DATE_FORMAT'
    KRTEMP 163 2005-06-27 17:09:30.0 3205 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS
    WHERE PARAMETER ='NLS_
    KRTEMP 163 2005-06-27 17:09:30.0 3205 DATE_FORMAT'
    KRTEMP 183 2005-06-27 17:09:30.0 3465 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS
    WHERE PARAMETER ='NLS_
    KRTEMP 183 2005-06-27 17:09:30.0 3465 DATE_FORMAT'
    KRTEMP 191 2005-06-27 17:09:26.0 5438 select appId from profile_application_tabl
    e wher
    KRTEMP 191 2005-06-27 17:09:26.0 5438 e appName=:1 and appVersion=:2
    KRTEMP 232 2005-06-27 17:09:31.0 5893 select s.username,s.sid ,s.logon_time, s.s
    erial#,sql.sql_text fr
    KRTEMP 232 2005-06-27 17:09:31.0 5893 om v$session s, v$sqltext sql where sql.ad
    dress = s.sql_address
    KRTEMP 232 2005-06-27 17:09:31.0 5893 and sql.hash_value = s.sql_hash_value and
    upper(s.username) like
    KRTEMP 232 2005-06-27 17:09:31.0 5893 'KRTEMP%' order by s.username ,s.sid ,s.s
    erial# ,sql.piece
    KRTEMP 34 2005-06-26 18:51:01.0 3629 rename tstore to store
    KRTEMP 37 2005-06-27 17:09:25.0 4209 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS W
    HERE PARAMETER ='NLS_
    KRTEMP 37 2005-06-27 17:09:25.0 4209 DATE_FORMAT'
    KRTEMP 74 2005-06-27 17:09:26.0 17625 select appId from profile_application_tabl
    e wher
    KRTEMP 74 2005-06-27 17:09:26.0 17625 e appName=:1 and appVersion=:2
    KRTEMP 83 2005-06-27 17:09:25.0 1771 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS W
    HERE PARAMETER ='NLS_
    KRTEMP 83 2005-06-27 17:09:25.0 1771 DATE_FORMAT'
    KRTEMP 111 2005-06-27 17:09:25.0 4878 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS
    WHERE PARAMETER ='NLS_
    KRTEMP 111 2005-06-27 17:09:25.0 4878 DATE_FORMAT'
    KRTEMP 232 2005-06-27 17:09:31.0 5893 select s.username,s.sid ,s.logon_time, s.s
    erial#,sql.sql_text fr
    KRTEMP 232 2005-06-27 17:09:31.0 5893 om v$session s, v$sqltext sql where sql.ad
    dress = s.sql_address
    KRTEMP 232 2005-06-27 17:09:31.0 5893 and sql.hash_value = s.sql_hash_value and
    upper(s.username) like
    KRTEMP 232 2005-06-27 17:09:31.0 5893 'KRTEMP%' order by s.username ,s.sid ,s.s
    erial# ,sql.piece
    KRTEMP 256 2005-06-27 17:09:31.0 2783 select s.username,s.sid ,s.logon_time, s.s
    erial#,sql.sql_text fr
    KRTEMP 256 2005-06-27 17:09:31.0 2783 om v$session s, v$sqltext sql where sql.ad
    dress = s.sql_address
    KRTEMP 256 2005-06-27 17:09:31.0 2783 and sql.hash_value = s.sql_hash_value and
    upper(s.username) like
    KRTEMP 256 2005-06-27 17:09:31.0 2783 'KRTEMP%' order by s.username ,s.sid ,s.s
    erial# ,sql.piece
    KRTEMP 9 2005-06-27 17:09:30.0 5436 select * from contact
    KRTEMP 34 2005-06-26 18:51:01.0 3629 rename tstore to store
    KRTEMP 37 2005-06-27 17:09:25.0 4209 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS W
    HERE PARAMETER ='NLS_
    KRTEMP 37 2005-06-27 17:09:25.0 4209 DATE_FORMAT'
    KRTEMP 74 2005-06-27 17:09:26.0 17625 select appId from profile_application_tabl
    e wher
    KRTEMP 74 2005-06-27 17:09:26.0 17625 e appName=:1 and appVersion=:2
    KRTEMP 83 2005-06-27 17:09:25.0 1771 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS W
    HERE PARAMETER ='NLS_
    KRTEMP 83 2005-06-27 17:09:25.0 1771 DATE_FORMAT'
    KRTEMP 105 2005-06-27 17:09:30.0 3296 select * from contact
    KRTEMP 111 2005-06-27 17:09:25.0 4878 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS
    WHERE PARAMETER ='NLS_
    KRTEMP 111 2005-06-27 17:09:25.0 4878 DATE_FORMAT'
    KRTEMP 153 2005-06-27 17:09:30.0 31065 select * from contact
    KRTEMP 163 2005-06-27 17:09:30.0 3205 select * from contact
    KRTEMP 173 2005-06-27 17:09:31.0 3922 select s.username,s.sid ,s.logon_time, s.s
    erial#,sql.sql_text fr
    KRTEMP 173 2005-06-27 17:09:31.0 3922 om v$session s, v$sqltext sql where sql.ad
    dress = s.sql_address
    KRTEMP 173 2005-06-27 17:09:31.0 3922 and sql.hash_value = s.sql_hash_value and
    upper(s.username) like
    KRTEMP 173 2005-06-27 17:09:31.0 3922 'KRTEMP%' order by s.username ,s.sid ,s.s
    erial# ,sql.piece
    KRTEMP 183 2005-06-27 17:09:30.0 3465 select * from contact
    KRTEMP 191 2005-06-27 17:09:26.0 5438 select appId from profile_application_tabl
    e wher
    KRTEMP 191 2005-06-27 17:09:26.0 5438 e appName=:1 and appVersion=:2
    KRTEMP 232 2005-06-27 17:09:31.0 5893 select s.username,s.sid ,s.logon_time, s.s
    erial#,sql.sql_text fr
    KRTEMP 232 2005-06-27 17:09:31.0 5893 om v$session s, v$sqltext sql where sql.ad
    dress = s.sql_address
    KRTEMP 232 2005-06-27 17:09:31.0 5893 and sql.hash_value = s.sql_hash_value and
    upper(s.username) like
    KRTEMP 232 2005-06-27 17:09:31.0 5893 'KRTEMP%' order by s.username ,s.sid ,s.s
    erial# ,sql.piece
    KRTEMP 256 2005-06-27 17:09:31.0 2783 select s.username,s.sid ,s.logon_time, s.s
    erial#,sql.sql_text fr
    KRTEMP 256 2005-06-27 17:09:31.0 2783 om v$session s, v$sqltext sql where sql.ad
    dress = s.sql_address
    KRTEMP 256 2005-06-27 17:09:31.0 2783 and sql.hash_value = s.sql_hash_value and
    upper(s.username) like
    KRTEMP 256 2005-06-27 17:09:31.0 2783 'KRTEMP%' order by s.username ,s.sid ,s.s
    erial# ,sql.piece
    KRTEMP 9 2005-06-27 17:09:30.0 5436 select * from contact
    KRTEMP 34 2005-06-26 18:51:01.0 3629 rename tstore to store
    KRTEMP 37 2005-06-27 17:09:25.0 4209 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS W
    HERE PARAMETER ='NLS_
    KRTEMP 37 2005-06-27 17:09:25.0 4209 DATE_FORMAT'
    KRTEMP 74 2005-06-27 17:09:26.0 17625 select appId from profile_application_tabl
    e wher
    KRTEMP 74 2005-06-27 17:09:26.0 17625 e appName=:1 and appVersion=:2
    KRTEMP 83 2005-06-27 17:09:25.0 1771 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS W
    HERE PARAMETER ='NLS_
    KRTEMP 83 2005-06-27 17:09:25.0 1771 DATE_FORMAT'
    KRTEMP 105 2005-06-27 17:09:30.0 3296 select * from contact
    KRTEMP 111 2005-06-27 17:09:25.0 4878 SELECT VALUE FROM NLS_INSTANCE_PARAMETERS
    WHERE PARAMETER ='NLS_
    KRTEMP 111 2005-06-27 17:09:25.0 4878 DATE_FORMAT'
    KRTEMP 153 2005-06-27 17:09:30.0 31065 select * from contact
    KRTEMP 163 2005-06-27 17:09:30.0 3205 select * from contact
    KRTEMP 183 2005-06-27 17:09:30.0 3465 select * from contact
    KRTEMP 191 2005-06-27 17:09:26.0 5438 select appId from profile_application_tabl
    e wher
    KRTEMP 191 2005-06-27 17:09:26.0 5438 e appName=:1 and appVersion=:2
    KRTEMP 204 2005-06-27 17:09:32.0 1478 select s.username,s.sid ,s.logon_time, s.s
    erial#,sql.sql_text fr
    KRTEMP 204 2005-06-27 17:09:32.0 1478 om v$session s, v$sqltext sql where sql.ad
    dress = s.sql_address
    KRTEMP 204 2005-06-27 17:09:32.0 1478 and sql.hash_value = s.sql_hash_value and
    upper(s.username) like
    KRTEMP 204 2005-06-27 17:09:32.0 1478 'KRTEMP%' order by s.username ,s.sid ,s.s
    erial# ,sql.piece
    KRTEMP 232 2005-06-27 17:09:31.0 5893 select s.username,s.sid ,s.logon_time, s.s
    erial#,sql.sql_text fr
    KRTEMP 232 2005-06-27 17:09:31.0 5893 om v$session s, v$sqltext sql where sql.ad
    dress = s.sql_address
    KRTEMP 232 2005-06-27 17:09:31.0 5893 and sql.hash_value = s.sql_hash_value and
    upper(s.username) like
    KRTEMP 232 2005-06-27 17:09:31.0 5893 'KRTEMP%' order by s.username ,s.sid ,s.s
    erial# ,sql.piece
    KRTEMP 256 2005-06-27 17:09:31.0 2783 select s.username,s.sid ,s.logon_time, s.s
    erial#,sql.sql_text fr
    KRTEMP 256 2005-06-27 17:09:31.0 2783 om v$session s, v$sqltext sql where sql.ad
    dress = s.sql_address
    KRTEMP 256 2005-06-27 17:09:31.0 2783 and sql.hash_value = s.sql_hash_value and
    upper(s.username) like
    KRTEMP 256 2005-06-27 17:09:31.0 2783 'KRTEMP%' order by s.username ,s.sid ,s.s
    erial# ,sql.piece

    Why do the connections stay open? Because you haven't closed them.
    You answered your own question: obviously closing the ResultSet is NOT the same thing as closing the connection.
    When you do a query, you want to get the connection, statement, and result set, load the data from the result set into an object or data structure, and then immediately close them all again in reverse order of creation. You want to keep the scope as narrow as possible. You want to use a connection pool to keep the cost of obtaining a connection down. You should leave caching of the PreparedStatements to the JDBC driver.
    %

  • SQL Developer 1.5.4: "Keep alive" setting to keep connections open?

    Is there any way to configure SQL Developer 1.5.4 such that it "pings" the server every now then to keep the connection open?
    It's very frustrating to be working on a script, step away from it for a while, and have SQL Developer freeze when trying to execute the next SQL statement.
    What can I do?
    My workaround--execute a "dummy" SQL statement like "select * from dual;" every now and then to keep a connection open.
    Thanks.
    Dana

    I have had this problem till I had a RAM upgrade.
    Since I have had the upgrade JDeveloper also responds well.
    A way to check is via task manager, if PF usage is more than you physical RAM size it is a indicator that you need more RAM or shut down some application that is hogging memory.
    Just to rule out if its not some other problem, have you tried working in SQL Developer running by itself or with one other program.
    Regards
    Edited by: io-into oracle on Jun 24, 2009 11:39 AM

  • VB6 - Keep Connection open?

    Hi,
    I have developed a VB6 application which logs on / connects to SAP and executes a number of RFC's.
    At the moment I have left the connection open throughout the running of my application, so that several RFC's can be executed without the need to log on / off each time. However, I have discovered that SAP messages being returned to me do not appear to be cleared (from memory) giving me incorrect messages. If the user stops and starts the connection each time before executing an RFC , this does not happen and messages / results are as expected.
    Should I be killing the connection for every RFC I execute, or am I missing some more basic refresh type of command?
    Another question, which may well be answered by the previous one: one of the RFC's I need to execute involves uploading from one line of data to many lines of data. I intend to loop through each line and execute the RFC for each line of data, as this appears to be how the RFC handles it. Given that I may have many lines and therfore many RFC calls, is it best to repeatedly call the RFC without closing the connection, as posted above? If I have to close the connection and re-open it each time as well as call the RFC, it could turn out to be a lengthy process.
    Hope you can advise,
    thanks,
    Steve

    Hi,
    I'm not quite sure I understand your question. If you want to open only a single connection and use only that connection, you'll have to do that in your code.
    What is your DBA complaining about exactly though? Do you accumulate sessions, is that why he/she is concerned? You have idle sessions not being used? How many sessions? etc.
    I'd check to make sure your code is cleaning up properly, and use connection pooling if you're not already.
    Hope it helps,
    greg

  • How many connection opened for webdynpro java

    Hi,
        I have 2 webdynpro java application.The applications sharing  the same backend function module.Could anyone tell me
      How many connection will be established when the same user wants to open 2 different application but these 2 application shares the same function module.
    Thanks
    Kanai

    Hi,
    In webdybnpro ,each Model in an Application utilizes a seperate Connection.If u create JCO connection pool for the User then while connecting to backend
    1)The JCO connection pool Manager will open a new connection pool and opens the first connection.
    The next available connection from the pool is allocated to the model object.
    2)The model object is now able to invoke the required functionality in the ABAP system.
    3) When the connection is no longer required by the application, it is returned to the pool.
    4) The connection remains logged on to the backend system until either the next application
    request is received, or the connection timeout is reached.
    5) If no application requests arrive before the timeout is reached, the connection is flagged
    for closure.
    Note:-If an Application contains 2 models which are connecting to same ABAP system then second Model can be told to share the same JCo connection used by First model This is done by calling its setConnectionProvider() method.
    Regards,
    Sunaina Reddy T

  • Keeping Connection open...

    If I have a thread that keeps a Conneciton open (or atleast monitors it and re-opens it if it closes for some reason) is this a good way to do it?
    public void run(){
         //-----Loop indefinetly
         while(!interrupted()){
              //-----Connect to the database
              try{                    
                  Class.forName("com.mysql.jdbc.Driver").newInstance();
                  //Where ams is the parent object that has the Connection as one of it's properties
                        ams.setConnection(DriverManager.getConnection(ams.getMySqlConnectionString()));
                  while(!ams.getConnection().isClosed()){sleep(1000);}
              //-----Display exception and sleep for a bit
              }catch(Exception e){try {sleep(1000);}catch (Exception ex){}}
    }

    I only need one connection so pooling seems to be an over the top way of keepign it open.
    I just wanted to put a simple little thread around my Connection object checking if it is open every so often and if not reopening it... Do you still think pooling is the way to go?

  • Workstations keeping connection open to the ZfD server

    Hi,
    I have the following situation:
    NetWare 5.1 SP6 server, with ZENworks for Desktops 3.2 SP3 installed. We
    use ZEN Imaging. Now, a lot of our workstations are keeping a conenction
    open to the server. In Monitor, the Network Address shows the IP address
    of our server. This makes it very hard for our administrators to keep
    track on which PC is connected to the network at the moment.
    How can I clear these connections, or better yet: how can I prevent them
    from coming up ?
    Thanks in advance.
    Arjan

    Arfman,
    It appears that in the past few days you have not received a response to your posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Do a search of our knowledgebase at http://support.novell.com/search/kb_index.jsp
    - Check all of the other support tools and options available at http://support.novell.com in both the "free product support" and "paid product support" drop down boxes.
    - You could also try posting your message again. Make sure it is posted in the correct newsgroup. (http://support.novell.com/forums)
    If this is a reply to a duplicate posting, please ignore and accept our apologies and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • Report quantity as blank or zero in the TO and keep it open for future pick

    Hi Gurus,
    We have a scenario here an dneed your help:
    We haev a transfer order created fro a delivery for 4 items. The system is showing that we have stock. While went for picking the one material is not there physically. While trying to confirm the TO in vl06o we can report blank for the material not picked and system converts it zero automatically. It ask for the confirmation of differences. If we say yes the system saves the TO and close it as confirmed. Now what will happen to the item which is not picked yet? How we can pick the remaining items? Is there any way?
    Thanks for any help...
    Shamsul

    I might be understanding correctly, but I use cursor variables within a package all of the time. I have never tried calling the procedures from C++ but it is fairly simple in Java and wouldn't think C++ would be much different, just more involved.
    In the package spec you have to define the ref cursor variable. If your cursor always returns the same rowtype then it is better to define the cursor, then define the ref cursor as c%rowtype. If the results of the cursor are going to change then you just define the variable as a ref cursor. These examples may help.
    CURSOR eu_status_cur IS
    SELECT eu_status
    FROM item_eu_status;
    TYPE eu_status_ref IS REF CURSOR RETURN eu_status_cur%ROWTYPE;
    TYPE component_ref IS REF CURSOR;
    The eu_status_ref will always return a single value row from the item_eu_status table while the second can return anything.
    The package procedure then defines the parameters as one of these types.
    PROCEDURE get_intermediate (
    i_containing_id IN item.item_id%TYPE,
    i_item_id IN item.item_id%TYPE,
    o_formula OUT formula_ref,
    o_eu_status OUT eu_status_ref,
    o_special_library OUT special_library_ref,
    o_sensory_attribute OUT sensory_attribute_ref,
    o_application OUT application_ref,
    o_raw_materials OUT raw_material_ref,
    o_intermediates OUT intermediate_ref,
    o_components OUT component_ref
    Within the procedure you just open the ref cursor.
    OPEN o_eu_status FOR
    SELECT eu_status
    FROM item_eu_status
    WHERE item_id = i_item_id;
    The client side will be different for Java vs C++ obviously. The OracleCallableStatement object takes care of most of the details when using Java, but since the (OCI) driver uses the OCI library I'm guessing that is where the real functionality is.

  • Keep 443 open for profile updates, but limit profile manager login

    I notice that port 443 is used by clients to communicate with the server when profiles are pushed (I assume as an encrypted connection for transmitting the profile file). Therefore it seems that for profiles to be pushed to devices outside the LAN 443 needs to be available when clients come calling to the FQDN to get a new profile (when Apple's push notification service says 'hey something is waiting for you').
    However, from a security standpoint I'm not thrilled about exposing the profile manager login to the page to the whole world. Is there a way to limit access to this page to say just our LAN (e.g., using .htaccess) and still allow clients to come calling to the server from anywhere on 443 to fetch profiles? How have others handled this scenario?
    Thanks!

    ...minor updates (see below) after some additional testing. Added /auth as this is another mechanism for authenticating against the admin panel. Also Added an additional allow for loopback traffic since logs showed some items being blocked on : : 1
    <Location /profilemanager>
        AllowOverride None
        Options MultiViews FollowSymlinks
        Order deny,allow
        Deny from all
        Allow from 10.0.0.0/8                   #OUR LAN
        Allow from XXX.XXX.XXX.XXX              #SERVER'S PUBLIC IP
        Allow from 127.0.0.0/255.0.0.0 ::1/128    #FOR INTERNAL LOOPBACK TRAFFIC
        Header Set Cache-Control no-cache
    </Location>
    <Location /mydevices>
        AllowOverride None
        Options MultiViews FollowSymlinks
        Order deny,allow
        Deny from all
        Allow from 10.0.0.0/8                   #OUR LAN
        Allow from XXX.XXX.XXX.XXX              #SERVER'S PUBLIC IP
        Allow from 127.0.0.0/255.0.0.0 ::1/128    #FOR INTERNAL LOOPBACK TRAFFIC
        Header Set Cache-Control no-cache
    </Location>
    <Location /auth>
        AllowOverride None
        Options MultiViews FollowSymlinks
        Order deny,allow
        Deny from all
        Allow from 10.0.0.0/8                   #OUR LAN
        Allow from XXX.XXX.XXX.XXX              #SERVER'S PUBLIC IP
        Allow from 127.0.0.0/255.0.0.0 ::1/128    #FOR INTERNAL LOOPBACK TRAFFIC
        Header Set Cache-Control no-cache
    </Location>

  • Even with recent powerbook g4 buy should i keep eye open for something newer

    Last week bought powerbook g4 that runs well; August 05 15", 1.67ghz, 2gb ram, 250gb hd, ilife & iwork 09, good dvd, cosmetically fine.
    Considering drawbacks of such old system will it be smart also purchasing newer Apple model? Having Macbook Pro in mind what kind of specs should be included assuring I'm  not stuck with two antiquated systems around same time? Thanx

    Hello,
    Well I've just recently purchased a MacBook Pro 2.4Ghz duo core 17" from 2007.
    It's not the most powerful, but it was a good price and runs the latest version of Mac OS X 10.8. The way I look at it, it's going to be at least two years or more before mountain lion will become obsolete .
    Should serve me well for a least two years and at £200 (300 USD) it's an affordable price.
    Sadly it means I won't be using my PowerBook G4 17" as much.
    But spec wise, look for a MacBook Pro 15/17 inch that mid to late 2007 plus
    The more RAM the better the performance.
    If it can run Mac OS X 10.8 then your know it want be too obsolete for a while.

  • How to Keep popupButton open to allow multiselect

    I have a popup button Having check box in it ..
    It is in Header Rendere of the column ..
    I want to keep it open For multiselect ...
    How Can I do that??
    TIA

    Are we talking about Spring here?
    Then this document is going to save you:
    http://www.jroller.com/kbaum/entry/orm_lazy_initialization_with_dao

  • Does calendar app need to be open for iCloud sync?

    Hi @all,
    I was just wondering the following about the sync function with iCloud: When I add a new calendar entry on my MacBook will it be pushed automatically to my iPhone from the cloud without having the actual calendar app open on the iPhone? I am asking because I am not frequently connected to a data network so what happens with this new entry in my calendar? Let's say I connect to a data network but don't open the calendar app. I leave the data network connection open for a while and then close it. After closing the data network connection I open the calendar app but the new entry does not appear. Will the new entry be synced to my iPhone only when I open the calendar app and only when I am connected to a data network at the same time?
    Thanks
    Martin

    Define background.  Do you mean the app open but minimized or app is actually not open.  I have photos in my dock for quick access.  It is closed and does not have the dot underneath showing it is open but minimized.  If the app is completely closed is iCloud working in the background upload/downloading photos?

  • Keep a Socket Server connection/port open for incoming requests

    Hi,
    I have a socket server which listens to the incoming messages. The problem is that the socket server terminates the socket connection once it receives a message.
    I want this Socket server to keep on running and process all the requests it receives.
    Can you please advise which stream shall be kept open for this to be achieved? Below is the code for your reference.
    Thanks!
    import java.net.*;
    import java.io.*;
    public class SocketServer
         public static void main(String[] args) throws IOException
                 ServerSocket serverSocket = null;
                 String result = null;
                 SocketServer sockServer = new SocketServer();
                 try
                          serverSocket = new ServerSocket(4444);
                 catch (IOException e)
                          System.exit(1);
                 Socket clientSocket = null;
                 try
                      clientSocket = serverSocket.accept();
                          clientSocket.setSoTimeout(30000);
                 catch (IOException e)
                      System.exit(1);
                 PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);
                 BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
                 String inputLine;
                 inputLine = in.readLine();
                 if((inputLine == null) || (inputLine.length() < 1))
                          throw new IOException("could not read from request stream");
                 else
                          result = sockServer.parseString(inputLine);
                          out.println("|0|OK|");
              InputStream is = null;
                  FileOutputStream fout=null;
                  BufferedInputStream bufIn = null;
                  HttpURLConnection con = null;
                  ByteArrayOutputStream baos = null;
                    try
                   URL url = new URL("http","10.176.96.64",8080,result);
                   con = (HttpURLConnection)url.openConnection();
                   is = con.getInputStream();
                   bufIn = new BufferedInputStream(is);
                   fout=new FileOutputStream("Z:\\Clips\\Cache\\"+result);
                   baos = new ByteArrayOutputStream();
                   int c = bufIn.read();
                   while(c != -1)
                        baos.write(c);
                        c = bufIn.read();
                   baos.writeTo(fout);
              catch(MalformedURLException mue)
                   System.err.println ("*********In Download File: Invalid URL");
              catch (IOException ioe)
                   System.err.println ("*********In Download File: I/O Error - " + ioe);
              finally
                   try
                        baos.close();
                        bufIn.close();
                        fout.close();
                        is.close();
                        con.disconnect();
                   catch(Exception ex)
                        System.out.println("*********In Download File: Exception Occured: "+ex.toString());
                      out.close();
                      in.close();
                      clientSocket.close();
                      serverSocket.close();
    }

    In a truly unexpected turn of events.. this question has been crossposted.
    http://forum.java.sun.com/thread.jspa?threadID=5127579
    Good job singalg. I highly recommend that instead of accepting that there is anything wrong with your understanding of how this should work and reviewing the tutorials you should instead repost this question daily, Each day choosing a different forum.

  • Keeping the connection open while in sleep

    I was just wondering if there is anyway to keep the internet connection open while the computer is in sleep mode? I have looked around for a little bit but I figured someone else probably already has an answer.
    Just to clarify I don't mean closing the laptop but just putting it into sleep mode. I've read you can't keep a connection open while the laptop is closed but I was wondering if there was a difference between putting it to sleep and closing the laptop.
    Message was edited by: Boogie Chillen

    No difference. If you need to keep the connection open, which is what I do, then set the Energy Saver to never sleep.

Maybe you are looking for

  • TABLE LINKS IN XL REPORT

    HI ALL WHILE USING XL REPORT, HOW THE TABLE LINKED WITH FIELD IN XL REPORT CAN BE KNOWN? Eg:IN XL REPORT OF EXCISE RG23A PART 1, FOR CHIT NO AND CHIT DATE, QUANTITY THE TABLES ARE NOT KNOWN TO FILL THE VALUES.PLEASE SOLVE IT, AND LET ME KNOW THE BEST

  • Microphone "not plugged in"

    I bought this laptop two days ago, and I cannot get the INTERNAL microphone to work. I went to my device manager under Sound and found that the device is enabled but "not plugged in." I tried disabling it and re-enabling it, and nothing. I also updat

  • JavaBean with Oracle Forms

    How can I JavaBean with Oracle Forms 10g. I attempting to use graphics (Aircraft Image created using SVG) interactively with Oracle forms. Any sample code to lead me in the right direction would be helpful.

  • Accessing Resource Central

    Pardon my asking this simple question as I suspect I am missing something obvious, (I did a search of the forum and did not find anything on it) Where and how do I access RESOURCE CENTRAL ? I want to look at the new scores as well as the sound effect

  • How to add external user in sharepoint using infopath web part

    hi, what i am trying to achieve is, 1. Create an infopath web part which will take email id of external user as input(ex: [email protected]). 2. Take an email id of that user into infopath form and add that to sharepoint group. 3. Now that newly adde