How to keep the connection to oracle db open  ?

Hi
I wrote a function that execute an oracle stored procedure , the function run for 400K times ,
right now i open connection on every time the function called .
the function called by another application ,
can i create a connection that will be open just one time ?
thank in advance ,
rami .

rami4tis wrote:
Hi
I wrote a function that execute an oracle stored procedure , the function run for 400K times , You call a db proc 400k times? You probably should look into not doing that.
right now i open connection on every time the function called .
the function called by another application ,
can i create a connection that will be open just one time ?
If not a pool than the class that does the 400k should have a Destroy/Close method that the caller would be responsible for calling when they are done.

Similar Messages

  • How to keep the connection alive?

    Hello! Happy new year!
    I have to write an HTTP server that comunicates with many clients in the same time,but keeps the connection with a client open if there the corresponding header is Keep-Alive. I have used threads,and I've tested my program in the following way: I've requested the one page of the site and then I've followed a link from that page. I expected that the broowser and the server talk to the same thread every time,but it seems that they don't. The code I've written is:
    //HTTPServer class
    ServerSocket serverSocket = null;
            boolean listening = true;
            try {
                serverSocket = new ServerSocket(80);
            } catch (IOException e) {
                System.err.println("Could not listen on port: 80.");
                System.exit(-1);
            while (listening)
                  new HTTPMultiServerThread(serverSocket.accept()).start();
    //HTTPMultiServerThread
    public void run() {
         //     System.out.println(socket.toString());
              try {
    while(!serverSocket.isClosed())){
                  DataOutputStream out = new DataOutputStream(socket.getOutputStream());
                  DataInputStream in = new DataInputStream( socket.getInputStream());
                  int nrBytes = in.available();
                  if(nrBytes > 0){
                       byte[] bytes = new byte[nrBytes];
                       in.read(bytes);
                       System.out.println("Procesez mesajul:" + nrBytes + new String(bytes));
                       HTTPMessage processedMess = new HTTPMessage(bytes).processMessage();
                       System.out.println("Inchid conexiunea.");
                        log("log.txt", new HTTPMessage(bytes).getStatusLine() + " " + new Data().getCurrentTime());
                   //send the message   
    out.write(processedMess.getBytes(),0,processedMess.getBytes().length);
                       /* inchid conexiunea
                  else{
                       String ret = new String("HTTP/1.1 500 Internal Server Error\n");
                        ret += "Host: cristi\n";
                      ret += "Date: " + new Data().getCurrentTime()+"\r\n";
                      ret += "\r\n";
                      ret += "<html><body><p>HTTP/1.1  500 Internal Serve Error</p> </body><html>\r\n";
                      out.write(ret.getBytes());
                  out.close();
                  in.close();
                       if(new HTTPMessage(bytes).getHeaderValue("Connection").equals("Close"))
                  socket.close();
         }//end while
              } catch (IOException e) {
                  e.printStackTrace();
        }I would also like to know how many clients are waiting to be served,in order to develop statistics about the server response time. 10X

    hi
    same to u .
    i think what i get from ur code that ....
    use some vector at the server side and whenever any client is connected (offcourse first time or not (depend on u !!)) create an object corresponding(generally created by server for every client) ..
    save this in the vector .. and pass it the size of vector to the client with the response .
    may this help u .
    regards
    akash
    Indiagames Ltd
    [email protected]
    India

  • Please help, urgent! How to hold the connection to oracle database

    I used java to connect Oracle database using thin driver. But I found out the connection will be closed very soon if I did not make any request of query. I query the database like after 1 mins without doing anything, my application will dead for about 2 mins, then everything become normal again.
    How can I hold the connection or is there any other solution? thank you!

    Duffy is, as usual, correct. If you have a single-user environment, then holding onto a connection is probably okay (not desirable but also not pernicious). However, once you have more than one user, you will want to use a connection pool. Jakarta Commons (jakarta.apache.org) has an open source pool that is reliable.
    But the fact that you are having additional problems makes me believe you are missing a few fundamental concepts, such as transactions. Even if the connection dropped, you should be able to reconnect without issue (granted, with some additional latency). The only time it would pose an issue (above and beyond the ones mentioned above and in previous replies) is if you are not managing your transactions properly.
    In short, take some tutorials on JDBC, DataSource, connection pools and transaction management.
    - Saish

  • How to determine the connection time?

    Hello!
    We have big troubles with our ConnectionPool. We have adapted most parts from the Book "Professional Java Server Programming" (Wrox Press).
    However, the connections are invalid (I/O Exceptions like "End of TNS Data Channel" or "Broken Pipe") after a while.
    The average up-time of our pool is approximately 24 hours.
    Now we want to drop renew the connections after a certain amount of time (let�s say 1 hour). To do this, we would need to determine the time when the connection has been established. How can this be done?
    I have looked into the DatabaseMetaData class, but did not find anything (at the first glance).
    PLEASE help me / us, the problem is really severe!
    Thanks in advance,
    Gregor Graf

    PLEASE help me / us, the problem is really severe!Where did you get the pool from? Is it your code? If so then are you sending a keep alive query - which would keep the connection active?
    If it isn't your code then are you explicitly returning the connections to the pool?
    Commercial pools don't typically drop connections. Some do which can be discovered by examining the configuration options for the pool that you have.
    If it is your code and you just want to add this, then you add a time value to each connection node. Each time a node is returned you set the time. You have a thread that runs and checks the time value, dropping any that are older than the value you want.

  • How to keep the filtered output in a page after user navigates back?

    How to keep the filtered output in a page after user navigates back to all records from another page.
    Currently it clears the search

    Hi,
    user13091824 wrote:
    How to keep the filtered output in a page after user navigates back to all records from another page.
    Currently it clears the search---While returing from page AM Return status should be True in pageContext.setForwardURL.:::
    pageContext.setForwardURL("OA.jsp?page=/XXX/oracle/apps/po/msg/webui/SearchPG",
    "SUPP_SEARCH",
    OAWebBeanConstants.GUESS_MENU_CONTEXT,
    null,
    null,
    true, // Retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
    OAWebBeanConstants.IGNORE_MESSAGES);
    ---After setting AM Status to true u can able to c the values.
    Regards
    Meher Irk

  • How to Troubleshoot the Connection Pool Exception?

    Dear Oracle Gurus, very good afternoon to you.
    I'm looking forward for some tips/troubleshoting guide to escape from the below exception, that occres very frequently to one of application that 100+ users will login from different locations & work on and update the data and save their work, where all in sudden they can't acces the application and it gets down.
    Most of the times in the server log I observed below.
    weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool RemoteDesktop.main to allocate to applications, please increase the size of the pool and retry..
    Please help me on, how to overcome this kind of exception.
    In Weblogi c server I see below kind of Warnings.
    If you set the buffer size to zero in a servlet, it would fail to respond and would initiate an infinite loop in the server. WebLogic Server would ultimately display a Errors:
    ExecuteThread: '157' for queue: 'weblogic.kernel.Default' has been busy for "633" seconds working on the request "Http Request: : ../updates/process_manager.jsp", which is more than the configured time (StuckThreadMaxTime) of "600" seconds.
    I searched over google for this kind of error, See otherusers posted the same kind of errors but didn't have any positive replies to troubleshoot this issue.
    I also got Oracle Dev link on Weblogic version upgrade product where they fixed similar kind of error it seems. Which is shown below.
    http://docs.oracle.com/cd/E13222_01/wls/docs61/notes/bugfixes2.html -- BUG # CR106186
    details:
    "Suspend Checker Thread" prio=10 tid=0x23eb90 nid=0xfec runnable
    <May 14, 2003 10:53:34 AM PDT> <Warning> <WebLogicServer> <000337>
    <ExecuteThread: '10' for queue: 'default' has been busy for "1,181" seconds working on the request "Http Request: servlet_uri", which is more than the configured time (StuckThreadMaxTime) of "600" seconds.>
    This problem was solved with a code fix.
    Looking forward for some help, Thank you inadvance.
    FYI..
    I'm using oracle thin driver JDBC connection/Weblogic 8.1
    Edited by: user1072948 on Apr 26, 2012 11:55 AM

    I agree that looking into the number of connections that you have open when you see
    weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool RemoteDesktop.main to allocate to applications, please increase the size of the pool and retry..
    would be a good idea; but I would suggest that you don't increase without thinking about the consequences. I would look more closely at what the connections to the database are doing, for instance, how long are the connection being left open for? What are the queries that are being run? Should you expect to see all the connections in the connection pool being used? What is the current connection pool limit? Are you simply going to increase the number of connections to find that they are also waiting? What is the load on the database at the time?
    It's the other error that you say you see
    ExecuteThread: '157' for queue: 'weblogic.kernel.Default' has been busy for "633" seconds working on the request "Http Request: : ../updates/process_manager.jsp", which is more than the configured time (StuckThreadMaxTime) of "600" seconds.
    What does this JSP do? Why would this be busy for so long? Is it related to the previous exception that you have? I'd ask you delevelopment team to look into this.
    In short, it sounds like you have load issues on your server(s) and a careful tuning of the system after a full analysis (thread dumps, heap profiling, connection pool monitoring and code review) would probably be beneficial. It may be that restricting the thread pool may help, it may be that increasing the connection pool would help. I'd not plump for a quick fix here.

  • Apple TV won't stay on file sharing, can anyone explain how to keep it connected ??

    Having problems keeping Applet TV connected for file sharing, Will disconnect in the middle of watching a movie. Can anyone help
    and tell me how to keep the two devises communicating??

    Is it just when streaming photos or using home-sharing in general? Check istumbler (netstumbler for windows) to check interference. Also check firewall and anti-virus (if applicable), restart router/make sure it's up to date.

  • Everything I own (iPad, iPhone, mac) is set up on wi-fi.  when i bring my work computer home (dell laptop), I cannot get it to keep the connection in a different room. All my other devices work.... does anybody know what i am doing wrong? please help!

    Everything I own (iPad, iPhone, mac) is set up on wi-fi.  when i bring my work computer home (dell laptop), I cannot get it to keep the connection in a different room. All my other devices work.... does anybody know what i am doing wrong? please help!

    Windows drivers for Intel wireless cards are known problematic.. If you have plenty of signal and it still cannot keep or hold the connection the issue can simply be the type of wireless.
    Another problem is using names that windows does not easily handle.
    eg If you set the TC using apple names, like
    Fred Blog's Airport Time Capsule wireless24ad12
    Then to windows this is too long.. it has spaces and it has illegal character.
    Change all names on the TC to suit windows. Short, no spaces and pure alphanumeric.
    Also security must be suitable.. I have no idea how old or what OS your dell is, but if you still have issues.. pull off the security on the TC for a test.. if the computer suddenly works, it is not compatible with WPA2 AES. Make sure you also use a password that is mix upper and lower case plus numbers.. avoid special characters and make it 10-20 characters long say.. it is not required to be more than that unless you are paranoid.

  • How to keep the MB powered on with Lid closed

    How to keep the MB powered on with Lid closed and no monitor connected?

    You can't. And you shouldn't due to heating issues.
    There are however 'hacks' that allow you to bypass
    this.
    http://www.alxsoft.com/mac/sleepless.html
    http://semaja2.net/insomniaxinfo/
    Blackbook C2D   Mac OS X
    (10.4.10)   120Gig, 1Gig, Superdrive.
    This may be true of overheating, but ONLY in the iBooks and very old laptops, if you think about it what is the difference between native clamshell mode (Using the monitor/keyboard etc) and the hacked clamshell mode? does plugging a screen in to the laptop some how create more ventilation :S
    This rumor is really really wrong, and as stated only affected the old machines which were not capable of native clamshell mode, but of course we keep the warnings there because we dont want to be sued if some idiot places it in there laptop bag while rendering a movie.
    PS. If anyone can give me evidence to prove otherwise i will add it to the investigation that im slowly compiling to "bust" this annoying myth

  • How to Transfer the Data from ORACLE APPS to SAP

    Hi Gurus,
    Here are my couple of quieries regarding Data Migration from Legacy(Oracle Apps) to SAP.
    1. How to link between Legacy system(ORACLE APPS) and SAP ?
    2. How to migrate the data from Oracle tables to SAP directly, instead of loading the flat files(.txt, .xls) ?
    Please respond to my queries ASAP.
    Thanks,
    SAPSURE.
    Edited by: sapsure on Sep 9, 2010 11:39 AM
    Edited by: sapsure on Sep 10, 2010 2:32 PM

    1. How to link between Legacy system(ORACLE APPS) and SAP ?
            If you have SAP PI in place then you can interact with oracle database tables directly from PI and then data can be posted to SAP transactions through IDocs/BAPIs.
            If you did not have SAP PI still you can do JDBC connection directly from ABAP program. Not sure about the exact steps check in forum.
    2. How to migrate the data from Oracle tables to SAP directly, instead of loading the flat files(.txt, .xls) ?
            If you want to directly post the data SAP transactions (I hope not directly to SAP tables) then connection needs to establish through ABAP program or Via. PI.
    Regards,

  • IO Error: The Network Adapter could not establish the connection in oracle

    Hi experts,
    I have oracle developer days installed in my vitrual box machine. The connection to oracle datatase (11.2.0.2) contained in the oracle developer days was working fine via sql developer. I use eclipse to write some java programs to connect the database. However, somehow, I cannot connect the database via sql deveoper anymore. This is the error I got when I tried to connect it via basic connection type:
    Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection
    Can anybody shed a light on this issue please. Thanks a lot in advance.

    user571093 wrote:
    Hi experts,
    I have oracle developer days installed in my vitrual box machine. The connection to oracle datatase (11.2.0.2) contained in the oracle developer days was working fine via sql developer. I use eclipse to write some java programs to connect the database. However, somehow, I cannot connect the database via sql deveoper anymore. This is the error I got when I tried to connect it via basic connection type:
    Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection
    Can anybody shed a light on this issue please. Thanks a lot in advance.Do you realize & understand that we are NOT standing behind you?
    I, too, am running Oracle Developer Days inside VirtualBox.
    On which system is SQL Developer installed?
    The post errors indicate an OS/networking issue.
    when was last time all worked without error?
    what changed since then?
    How do I ask a question on the forums?
    SQL and PL/SQL FAQ

  • How to find the CONNECTION STRING

    how to find the connection string through SQL Statement?
    salahuddin/salahuddin@CONNECTION_STRING
    Below is all about my sql version:
    DEFINE SQLPLUSRELEASE = "800060000" (CHAR)
    DEFINE _EDITOR         = "Notepad" (CHAR)
    DEFINE OVERSION = "Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options" (CHAR)
    DEFINE ORELEASE = "1002000100" (CHAR)

    In windows XP plateform your can find from the ServicesHow can you do that using SQL statement? Plus connect strings are not available in Services. In post 9i SQL*Plus we can do it in SQL statement like this
    SELECT '&&_CONNECT_IDENTIFIER'
    FROM dual;
    Note: This will work only in SQL*Plus.

  • Keeping or not keeping the connection?

    Hi!
    I'm wondering what is better. If my program need to connect to Oracle lot of times, it's better to connect once at the begining and keep the connection to the end of program? Or maybe it's better to connect everytime when some data from database is needed?
    Thanks in advance,
    Jacek

    That all depends on what your application wants.
    If your application is online and require high performance , then keep the connections, however this will have impact on server side with unnecessary connections holding for long time.
    If your application is not performance oriented then you can afford to connect whenever required.

  • 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.

  • How to keep the WBS & Order in account assignment tab of SD contract item?

    Hi Experts,
    If I remove the plant from the shipping tab in the contract item (the contract type is WV), I will be able to enter the WBS or Order in accounting assignment tab. However, if I enter the plant (in order to determine the tax in pricing), the WBS and Order are disappered and there is one new settlement rule button showed up.
    Do you know any configuration could keep the WBS and order in the accounting assigment tab even the plant is there.
    Thanks in advance!
    Norman

    Hi Chandra,
    Thanks for your answer. However, I even added the plant in the WBS, the tax (we use tax jurisdiction) still could not be determined.
    The problem is that SAP changes the account assignment tab screen (it suppresses the WBS and Order fields, but addes settlement rule) with the plant in the shipping tab. Do you know how to keep the same account assignment tab screen with the plant in the shipping tab?
    Thanks,
    Norman

Maybe you are looking for

  • Calendar stuck in year view

    On my iphone 4 using ios7.02 the calendar is stuck in year view.  There are no tabs.  I can't escape.  I tried quitting and restoring the phone, that did not work.  How do I get back to the classic month view with the tabs?

  • Garbage characters in german admin pages after update to 3.0

    After Update to 3.0 there are garbage characters display instead of German special characters (äöüß ...) looking like ... " löschen " or "Unterstützende Objekte" In the applications these characters displayed correctly -even the Buttons ... - only

  • Restoring messages not visible in Mail (but still visible using Finder)?

    While renaming and shuffling a couple of folders (mailboxes), one of the folder's contents entirely disappeared. At first, all the messages appeared to be there (with the subject and addresses in the top pane) while a note to the effect of "this mess

  • Why are cookies not updated in the request when meta refresh is used?

    I've written a web site that uses IIS Forms Authentication. It's configured to use authentication tickets with a sliding expiration. FireFox allows the ticket to expire while it works fine with Internet Explorer. The web site uses a Keep Alive page t

  • Loading Images CS5 32 & 64 bit

    When I load an image (jpeg etc) into Photoshop it shows up in the layers palet as a background but does not show in the workspace, where I see a chequered background. How do I overcome this? What am I missing? This is the trial version of CS5 Extende