Same Session using URLConnection

We have written a utility whick keeps monitoring the site for the uptime. It hits the site on a regular time interval. We are using URLConnection Object for connecting to the site, the problem here is with each connection made by URLConnection object it creates a new session and hence increases the number of sessions.
How do I user URLConnection or similar object so that it does not create new session every time it hits the server.
Thanks for the help in advance!!

We have written a utility whick keeps monitoring the
site for the uptime. It hits the site on a regular
time interval. We are using URLConnection Object for
connecting to the site, the problem here is with each
connection made by URLConnection object it creates a
new session and hence increases the number of
sessions.
How do I user URLConnection or similar object so that
it does not create new session every time it hits the
server.
Thanks for the help in advance!Dear sir,
Do you solve your question in this topic?
I have similar problem.

Similar Messages

  • Two bapi calls in the same session using PI

    Hi,
    I have a file to RFC scenario wherein I need to call a BAPI (L_TO_CANCEL) and then again, I need to call another bapi called
    "BAPI_TRANSACTION_COMMIT" in the same session. My question is, if I use RFC adapter, do I have to call the commit bapi again?
    If yes, is there anyway I can do that ?
    I believe that will be the case only if I use a proxy. Is that correct ?
    The requirement is to call these two BAPIs and finally include a success or error message in the response.
    Thanks.

    Inside the BPM you do not have a specific exception message. You can do an exception handling based on the exception, but the excpetion itself is not a real message.
    If you want a real message, you could create an ABAP proxy, which has a message like this:
    root
      - part1
           - rfc response
       - part2
            - error text
    then you can split this inside BPM and send a the response or the error.
    Of course there are other possible solutions.

  • How to track the same session using both jsp and servlets

    Hello, guys:
    "how to use jsp and servlet to track the same session",
    it seems to me my logoff.jsp never realize the session I established in my servlets.
    Here is how I set my session in my servlets:
    "     HttpSession session = req.getSession(true);
    session.setAttribute("userid",suserid);"
    Here is how I invalidate my session in my logoff.jsp
    " <%@ page language= "java" %>
    <%@ page import="javax.servlet.http.HttpSession" %>
    <%@ page session="false"%>
    Our Session id is : <%= session.getId() %>
    <% session.removeAttribute("userid");
    session.invalidate();
    %>
    Our Session id is : <%= session.getId() %>"
    but when I try to logoff using the logoff.jsp
    I always get following error message.
    "/home/jiao/jsp_webserver/tomcat/work/Standalone/localhost/syllabus/htmls/logoff_jsp.java:50: cannot resolve symbol
    symbol : variable session
    location: class org.apache.jsp.logoff_jsp
    out.print( session.getId() );"
    T.I.A.
    [Edited by: jiveadmin on Jun 18, 2003 10:32 AM]
    [Edited by: jiveadmin on Jun 18, 2003 10:33 AM]

    So,
    <%@ page session="false"%>
    That means the jsp never instantiates the build in session object.
    <%@ page session="true"%>
    means jsp will instantiates a session object if there are no existing ones
    how about I just delete the line,
    does that mean the jsp will find the existing session object for me?
    So I can do something like
    Our Session id is : <%= session.getId() %>
    <% session.removeAttribute("userid");
    session.invalidate();
    %>
    directly.
    T.I.A.

  • Can a report use the same session as a calling form?

    Hi,
    I am using Oracle Forms and Reports 6i. I am wanting to call a report from a form and open it in the same session. The form will insert information into a number of global temporary tables that the report will use to display the query information.
    Is this possible? If so what is it I need to do to acheive this? At the moment I am using the run_product which calls the report with a parameter list. This opens the report fine but in a different session.
    Regards,
    Scott.

    Scott,
    no they don't share the same session. You can use parameter lists and pass them in a call to run_report_object (or run_product if this is the built-in you are using) to the Reports module. When creating the parameter list, you can get the data from either global variables or filed sin Forms. All you need to do is to make sure the equivalent parameter names are created as user parameters in Reports.
    Frank

  • Values of same Variable(used in diff reports) shud be retained in a session

    Hello,
    We have an application cockpit. There are 12 to 13 different reports being used in that cockpit. Most of the reports use the same characteristic variables in the report.
    When we used to execute these reports in Ver 3.x, the variables used to retain their values in the same session. i.e. if for 0Material, user gave : 'TIP120' as a value in selection criteria in one report, then, if he executed another report after that, which uses the same variable on 0Material, then it retained its previous value: 'TIP120'. 
    Recently we have migrated to BW 7.0. Now, the variables no longer retain their values in the same session and the user has to type the value again. (personalization is an option but we want the variable should retain the values in same session).
    Any help/advise on this will be of great importance as the user is not very comfortable putting values again, each time he runs the report.
    Warm Regards,
    Sumita

    Hi,
    Although this may not be the ideal answer for your question. This is another solution for your Question.(Personalizing Variables)
    Go through this link... This will help you for sure
    http://help.sap.com/saphelp_nw04/helpdata/en/3f/30ae3d47afd652e10000000a114084/frameset.htm
    Hope This Helps,
    Regards,
    rik

  • Stateless Session EJB hangs using URLConnection but WLS doesn't clean up

    Hi
    We have a stateless session EJB running under WLS 5.1 with service
    pack 10 on Solaris.
    The bean calls a remote HTTP server using the java.net.URLConnection
    class and forwards the response to the EJB client. The bean is largely
    working fine but some threads hang waiting on the HTTP response. Debug
    statements, which are written immediately after the response has been
    read and the connection has been closed, do not appear in our log for
    the hung threads. The WebLogic Console displays these threads as "in
    use" and a "netstat -an" displays the tcp connections as ESTABLISHED.
    However, the access logs of the remote Apache server show the HTTP
    connections of the threads in question completed successfully with
    HTTP code 200. The Apache server is using keep-alive connections.
    Some EJB threads are still waiting for something it seems.
    Has anyody else experienced this when using URLConnection from
    stateless session EJBs under WLS?
    The second problem is why doesn't WLS time these threads out after
    trans-timeout-seconds (we're using the default of 300 seconds)? The
    WLS log shows no error messages relating to this problem.
    I'm grateful for any info offered.
    Thanks in advance
    Steve

    If you suspect that WLS protocol handler is at fault (and quite often it is),
    one thing to try is (if you use Sun's JVM) to use Sun's HTTP protocol handler
    instead of WLS (the most common symptom is when code which makes HTTP requests
    works fine outside of WebLogic and you have problems getting it to work inside
    WebLogic) :
    replace
    URL url = new URL("http://...");
    HttpURLConnection conn = (HttpURLConnection)url.openConnection();
    with
    URL url = new URL(null, "http://...", new sun.net.www.protocol.http.Handler());
    HttpURLConnection conn = (HttpURLConnection)url.openConnection();
    You will have to edit weblogic.policy to allow your code to specify protocol
    handler.
    Also note that transaction timeout is only checked on method boundaries, or
    when your code attempts to do something with the database - it is not going to
    interrupt thread which is waiting for HTTP response.
    Steve Lock <[email protected]> wrote:
    Hi
    Thanks for the info. The remote HTTP server's access log shows that
    the requests were successfully processed. Doesn't this mean that the
    connection is then closed? I know the web server is using keep-alive
    connections but I thought this was transparent to the client...?
    Also why doesn't WLS remove the hung threads?
    Steve
    "Ignacio G. Dupont" <[email protected]> wrote in message news:<[email protected]>...
    We have had a problem like yours with Weblogic 6.1 SP2 on Linux
    The problem is sun's implementation of the HTTP connections doesn't have a
    timeout, so if the other peer doesn't close the connection your threads will
    be "locked" on the connection.
    We have found searching the web that the Jakarta project has a package
    called Jakarta commons that implements HTTP connections with an
    setSoTimeout(int timeout) method so you can open the connections with your
    desired timeout. You have to download the code from the CVS as the released
    version doesn't support the timedout sockets yet.
    When support for the JDK 1.4 version will be announced by Bea you could use
    one of its new features that will allow you to pass arguments to the JVM to
    specify the maximum socket connection stablising timeout and the max
    inactivity on the socket too.
    Hope it helps you.
    Dimitri

  • Shopping cart - prevent same session ref being re-used after an order ?

    Whenever a user enters site and new session is created, along with a unique session ref (uuid).
    Various housekeeping is performed when the session expires
    BUT, how do I prevent a user who's just ordered, from returning to the site and re-using the same session ref ?
    What's the best solution ? Can I prematurely expire the session, or perhaps start a new one and attach this user to it ?

    Dax Trajero wrote:
    ... how do I prevent a user who's just ordered, from returning to the site and re-using the same session ref ?
    Deny a returning paying(!) customer his session? Yours might be the only shop in town doing that.
    If your session housekeeping is any good, then the session variables  pertaining to shopping-cart, payment and delivery would have been  cleared or re-initialized. Often, starting a new session means logging in again. There are a number of reasons why that can be undesirable.
    I did an e-commerce course for a year, and learned some strange things. It is in fact to your advantage that a returning customer should keep his session, even after ordering.
    For example, it is well known that the chances of a returning customer placing a new order is much higher when he is already logged in than when he has to log in afresh. You could test that hypothesis yourself. Psychologists have also found that e-shoppers often return to the shop to gloat at the goodies they've just ordered. You wouldn't want to deny them their gloating session, would you?

  • Restrict same user using same internet explorer session

    Hi,
    I encountered a problem here. Hope some one had deal with this problem can help me out.
    The application was written in BSP. The users are using Internet Explorer 6.0 and 7.0 to use the application.
    The problem I encountered here is after an user is logged in to the system through the browser, then he open another new window or tab (ctrlN or ctrlT), the application will not prompt him to login again because the sessions were shared between this two internet explorer. I do not want this to happen because it giving problem and causing data loss.
    Any possible way to restrict user to open two same application within same session? Because the problem will not occur if the user open two same application within different session.
    I really appreciate for those who can help me on this.
    Thanks you.

    Check OSS notes for this - there are a number about aspects of BSP logons.
    I believe this is to do with a cookie being held / kept alive that should not be.  There are some OSS notes about this issue - you may have to redefine how the user logs on so that HTTP Basic Authentication is not used.
    Andrew

  • Can we use same session again and again

    can we use same session again and again.....in BDC
    thanks,
    venki..

    Hi
    Till all the records in that session was properly uploaded into the system you can use the same Session again and again.
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Getting two differents UrlConnection.inputStream() over the same Session

    I need to access two diferents webservices by GET method but to access the second one the session created by the first must be alive. Till now, I got something like the following code but this code doesn�t let session keep alive. I would like to advise that I cannot use web tools like servlets to manage this =/
    DocumentBuilderFactory dbf;  
       DocumentBuilder docBuilder;  
       public ClasseXML(){  
          dbf = DocumentBuilderFactory.newInstance();  
          try {  
             docBuilder = dbf.newDocumentBuilder();  
          } catch (ParserConfigurationException e) {  
             alerta("Parsing error: "+e.getMessage());  
       public void request1(String params) {  
          try{     
             String url = myHost+"/"+params;  
             Document doc = docBuilder.parse( new URL(url).openStream() );  
       public void request2(String params) {  
          try{  
             String url = myHost+"/"+params;  
             System.out.println( url );  
             Document doc = docBuilder.parse( new URL(url).openStream() );  
    ...  

    So you are connecting to Server X, and you want to send two web service requests to that server? And you want the server to process both requests in the same session?
    If that's what you mean, then you have to do whatever the server wants you to do to maintain the session. Often servers send a cookie to the client and require it to be sent back to maintain a session, but that's not the only way. Your first step is to find out how the server is maintaining the session. If there's no published information about that, and you have nobody to ask, then you would have to reverse engineer the requests and responses in a normal session.
    Then you would have to write your code to send the same requests and handle the responses accordingly.

  • How to use "URLConnection" in sessions with more than one screen??

    Hi,
    Requests can be sent to http servers using "URLConnection" objects. The responses can be parsed via their InputStream; so far so good...
    Question is:
    What can I do when I want to send a request to a server where there is first a log-in screen and only then there is the desired screen where the real request should be sent?
    Since the REAL request cannot be directly sent without the authentication check first, I need some kind of "context" or session in which I may make some consequent actions... Sending an independent request using a diferent URLConnection just won't do since I'm unauthorized via the second connection!!
    Generally, I need a way to send consequent requests where the second request may be sent only if the first request authenticated me...
    How can I do that? (Hope my question is clear...)
    --Amir.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Well, you will have to deal with the cookies or however the server knows you are authenticated. Personally I prefer to use something like Apache HttpClient rather than dealing with icky details like that on my own.

  • When using Adobe Photoshop CS5, print settings default within the same session.

    Windows 7 Pro 64 bit.  As mentioned after adjusting some settings and printing, the settings reset the next time we go to print the same file within the same session. (never closing the file)

    Hi Chris,
    I will definitely give that a try. I had a tech set up my computer after i purchased it less than a week ago but it is a possibility that he missed it. I will try and run an update this weekend and see if that increases the speed when OpenGL is enabled. I will get back to you on the issue in the next few days.
    Thanks for your insight and helpful suggestion.
    Much appreciated.
    -Darren

  • How to submit a child concurrent request in same session as its parent?

    Hi All,
    I need one help. In one of my program, I am using something like this
    fnd_request.submit_request ()—prog A
    fnd_request.submit_request ()—prog B
    fnd_request.submit_request ()—prog c
    now I want prog A,B and C to use same session. the moment I use fnd_request.submit_request, it opens a separate session, I want to use same session. I even tried with request set but didn’t work.
    Kindly help on this.
    Kind regards
    Sandy

    Hi,
    now I want prog A,B and C to use same session. the moment I use fnd_request.submit_request, it opens a separate session, I want to use same session. I even tried with request set but didn’t workThis is an expected behavior, and I believe there is no way to have all requests running under one session.
    Regards,
    Hussein

  • HOW: To save/refresh data from different forms but in same session

    Hi
    I have 2 screens
    Screen-1
         Tabluar form with 10 rows and each row corresponds to one edit image
    Screen-2
         Forms type form with multiple text items and list items and one OK and cancel button
         If I click on OK button, whatever I enter in screen-2 is updated but till now no commit only EXIT_FORM and the screen is going back to Screen-1
    In Screen-1 I have written trigger When-Wiindow-Activated, which has to refresh the screen-1 values with the changed values from above screen-2
    BUT this is not happening. (I am using SET_BLOCK_PROPERTY... and EXECUTE_QUERY to refresh, by passing the query string)
    Also I have one save button in Screen-2 which should commit whatever I have updated in Screen-2 (once or muyltiple times)
    I am opening the Screen-2 from Screen-1 by using OPEN_FORM built in with form name and ACTIVATE,NO_SESSION and also the parameter.
    Please let me know if I am doing any mistake in calling or some properties need to be set.
    I assume that, as the aplication is in the same session then the newly edited record in screen2 should get reflect in screen-1, and should get saved once I click on save button in screen-1 (FORMS_DDL('COMMIT'))
    regards
    JC

    I assume that Screen 2 is not based on table as it doesn't prompt you "Do you want to save chages" on exit.
    So you probably just updating with update statement.
    You will need to call POST; before exit_form in screen 2.
    Post;
    Exit_Form(NO_COMMIT, NO_ROLLBACK); Also in screen 1, instead of OPEN_FORM and re-query in WHEN-WINDOW-ACTIVATED, I would suggest to use call_form and re-query just after call_form:
       CALL_FORM('xxx',no_hide, no_replace, no_query_only, pl_id);
       SET_BLOCK_PROPERTY ('YOUR_BLOCK' ...
       GO_BLOCK('YOUR_BLOCK');
       EXECUTE_QUERY;

  • Same session in different computers

    hi all,
    i have a web reporting package running in sun java application server. i am keeping user object in session scope with following code in all pages which need user information like user.name, user.message, etc.
    <jsp:useBean id="user" class="somepackage.User" scope="session" />
    i have a front controller to check authentication and authorization. that i developed a year back. it was working fine. from that time i never concentrated on authentication and authorization because that front controller is taking care of authentication and authorization of all requests.
    today i observed that if i login in one computer, who ever uses that web application next in another computer, is getting my username and my privileges.
    in my first observation it is happening only to explorer. i will check firefox thoroughly tomorrow.
    i am using this logic for the last few years without any problem.
    the users are behind firewall/proxy server (because i can see only one ip address for all of them.)
    can anyone help me in solving this? or how to proceed or how to separate the problem...etc
    thanks in advance,
    ksmoses.

    vignesh and BalusC,
    following is the code in front controller's doFilter method. is this not thread safe?
            HttpServletRequest req = (HttpServletRequest) request;
            HttpServletResponse res = (HttpServletResponse) response;
            HttpSession session = req.getSession();
            somepackage.User user;
            if(session.getAttribute("user") == null){
                user = new somepackage.User();
                session.setAttribute("user", user);
            }else{           
                user = (somepackage.User) session.getAttribute("user");
            }user object maintains all information about a user. if it is in session scope, everything should work fine.
    another observation is after some time of usage, both people in different systems are getting same session.getId()
    in my logout page i am using
    session.invalidate();
    thanks,
    moses

Maybe you are looking for

  • Updated OS to 10.1.0.418​1 and can no longer send texts

    I got prompted for a BB10 OS update to version 10.1.0.4181. I downloaded and installed the OS without any issues, took about 25-30 minutes. Now I can no longer send or receive text messages (every other feature seems to be working fine, including ema

  • How can you get your ipod touch open when you forgot the password and its disabled and not connected to wifi

    How can you get your iPod touch open when you forgot the password and its disabled and not connected to the Internet Connection and you don't want to reset it.

  • The Sims 2 Holiday Pack digital download?

    Not sure where to post this, but I'm wondering where I can purchase the Sims 2 Holiday Pack for Mac online, and have it available as a digital download? Seems like I have t o have it shipped, but I'd rather just download it.

  • Why does my video keep buffering?

    I am trying to watch a video on PBS.org with my MacBook Pro but am unable to because it keeps buffering. What's odd is, I am able to watch the same video on on the same website with my iPhone 4 with no problem. Why is this? Both the phone and the com

  • Editing EP 6.0 Logon Page

    Iam trying to Modify the EP 6.0 Logon page.. I read forums tips to do that but endup creating an error page. Actual par file: com.sap.portal.runtime.logon.par I juss tried 2 replace sapLogo.gif with my company logo..then placed the par file back in t