Keep DB Connection Open

I have an Oracle stored procedure that I need to call for a list of records in Crystal.
What I have done is created a UFL to make the call and provide the return results.
I call the Custom Function for each record returned however, it's taking a long time to process.
I believe this is because the connection to the oracle database is being opened, called and closed for each record.
Is there any way to open the connection when the reports starts running, return the results for each record and then close the connection when the report completes?
Any help would be appreciated.
FYI - I am using CRXI R2
Ray

Hi Raymond,
The reason why CR opens/closes for each record is because you are using a UFL it's going to be processed on the second pass of the report which means because it's a formula CR will process it after the connection is closed. If CR can convert the formula into SQL then it happens server side but in your case you need to run the query for each record.
Have you had a look at using a Command Object? It would require returning all of the data but at least the ufl function would then filter on the Command data and not hit the database. You may have to re-write your UFL functions so it doesn't go to the DB but uses the cached data in the Command object.
Another option would be to write your own OLE DB Provider. DataDirect who we partner with for data sources, offers an SDK so you can build in security and anything else you need or would like to have.
http://web.datadirect.com/products/custom-driver-sdk/index.html
As for stopping CR from disconnecting that won't happen. We release the connection to free resources once we are done, keeping the connection open causes problems for all applications like Brian indicated.
You may have to re-design your report and do the filtering client side rather than server side.
Thank you
Don

Similar Messages

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

  • 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

  • Can I keep a connection open between transient application block calls?

    Hi all;
    I am going to make a bunch of discrete updates to my Sql Azure database. If the first 5 succeed, and then on #6 it fails, and I'm doing all this in a transient application block, then:
    I don't want to do transactions because it's fine if it fails after N updates and transactions have overhead - correct?
    If the IDbCommand.Execute() returned successfully, I can then consider that update complete & successful - correct?
    Is there any downside to running more updates, even if it's tens of thousands, all in one transient application block, as long as I'm calling the next one as soon as the previous one completes - correct?
    This will all probably be in a web worker where it reads from a queue and then makes the update to the DB. Is there any downside to putting all this code inside a transient application block and it just runs there until a call fails?
    What I'm looking at doing here is a bit different from the examples which always show a small short example. We're going to have a giant volume of updates we need to do, handling them as they come in. Setting up a transient application block, creating
    & opening a connection, to then do one update, would be a ton of overhead - I think.
    How do people best handle this situation?
    thanks - dave
    What we did for the last 6 months -
    Made the world's coolest reporting & docgen system even more amazing

    Hi Dave,
    Thank you for your question.
    I am currently looking into this issue and will give you an update as soon as possible.
    Thank you for your understanding and support.
    Regards,
    Charlie Liao
    TechNet Community Support

  • 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

  • Keep JDBC connection alive

    Hi,
    I am running into problem with JDBC connection outside of the firewall. The firewall disconnect idle connection after 15min. Is there a way to keep JDBC alive for
    as long as the application is running?
    Thanks,

    Notwithstanding connection pools generally managed by an application server, I would not advocate keeping a connection open beyond the immediate need for it. Certainly there is a performance cost to open a connection and that must be weighed against the potential for orphaned resources by leaving a connection in a trapped state. Personally I have never found an overriding NEED to keep a connection open beyond the method where the connection was first opened.
    Using a connection pool makes the cost even less to open and release connections on an as needed basis.
    Just my 2 krupplenicks worth, your mileage may of course vary.
    PS.

  • How do I keep a meeting open on Adobe Connect continuously?

    I was wondering if anyone could tell me how to keep a meeting open continuously on Adobe Connect? So that anyone could enter the meeting at anytime. Please help.

    If you have the Named Organizer license, then the member of the Meeting Host group must be in the room and active. Active meaning that that user is focused on the room and the mouse is moving. I recall that Connect will close a room without activity for ~6-8 hours.
    If you have the Concurrent User license, then anyone can come and go from a Meeting as needed.
    The Named Organizer licensing is a license for an individual to run a meeting, where the Concurrent User license is a license for individuals to be in meetings.

  • Is it wise to keep the socket connection open?

    When u have a bunch of HTTP requests coming in to a listener server socket, would it be safe to keep my JAVA socket connection open with KeepAlive or simply open/close at will? I thought of a connection of sockets as well. Thoughts? thx!

    It depends which socket your talking about
    The serversocket you want to always be open and listened to
    the sockets it spawns you should close when you've finished the transaction

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

  • Using LabVIEW 6i w Win NT or 95/98 et al: how do you keep a TCP/IP open connection 'open'. The application closes the connection even though the refnum is still active (valid.)

    Actually, I open the TCP/IP connection and pass the connection ID through. Each command to/from (cycle) the UUT successfully executes. The refnum for the connection ID is then passed via a shift register in the while loop. i am using the type cast (4X) function to determine the validity of the connection and case statements. If the refnum is non-zero it assumes the connection is still open; if the result is zero, then the connection is closed and a new session opened in that case. What is happening is that the connection has closed and the refnum is still nonzero after the type cast function; su
    bsequent commands to the UUT then produce Error 1 for the TCP/IP function (there was no open connection, so there could be no write occurrence.) Obviously, this probably shouldn't be happening. If someone can give me some idea of what I am not doing, or am doing wrong, I sure would appreciate it. In the event that I open and close a connection for each command to(from)(cycle) the UUT everything works. It is extremely slow. The connection should remain open according to all the pointers in the Help and TCP/IP function descriptions. Some of this application is proprietary, so not sure how much of an example I could use to illustrate from a VI, but if this doesn't get any where, I will see what i can do to better illustrate the problem...Thanks. T.Raper

    I believe this is a related question. I am developing a LV application the uses TCP/IP to control up to 8 devices-under-test (DUT) at one time. They start and finish testing at arbitrary times relative to each other, and the IP addresses are not known until the DUT arrives. I have some question on what is the best way to manage the TCP/IP handles.
    Presently, I have 8 Global IP addresses (one per testing site) that are updated as DUTs arrive and depart, and then whenever I need to communicate with a DUT I use TCP-Open, Write/Read, and TCP-Close. I do this Open/Write/Close each time there is a message to be sent to a DUT. This is basically working, but I notice that the OS (Windows XP or 2000) is running through local TCP/IP ports at a ferocious rate due to the TIME_WAIT behavior of Closed TCP/IP ports (It takes many minutes for a local port to become available again after being closed). If I am not careful, I can quickly exhaust the pool of OS ports by using tight polling loops or other very quick DUT accesses. I have tried not to do that in order to avoid running out of handles, but it is still very wasteful of ports.
    While it is working, I feel so dirty burning through these handles like this since they appear to be a precious resource. I really cannot easily merge multiple Read/Writes into a single Open/Close since there are dozens of otherwise unrelated tests that communicate with the DUT as a part of their functionality. The tests are even in different subVI's that are accessed via a vi-server, and only one is loaded at a time.  
    I thought that a cute idea would be to cache the handles in Globals, and wrap the Open to use the cache if valid, but reading this thread is making me think it is a lot of effort -- I believe I would need to keep a VI running as a "IP Connection Server" at all times and use some form of messaging to get it to Open/Close TCP connections as needed. Since the DUTs arrive at aribitrary times, and with random IP addresses, I cannot establish all the TCP handles ahead of time -- they would need to be created dynamically. It is much more difficult than simply keeping the Connection IDs in global variables -- the VI that Opened them must not be allowed to terminate.
    So... I am curious...... is it really that bad to Open/Close as frequently as I am doing it? Does it make me a bad person? I understand it is inefficient use of time, but the simplicity it brings to the structure seems huge, and the DUT is very slow anyway. And if it is bad, are they any more recent thoughts on alternatives? Do VISA handles behave the same way as TCP handles (ie. auto-close themselves upon exit of the VI that Opened them) ?
    Message Edited by Mike Seibel on 11-28-2005 07:55 PM
    Message Edited by Mike Seibel on 11-28-2005 08:00 PM
    Message Edited by Mike Seibel on 11-28-2005 08:01 PM

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

  • OSB using socket Transport ,how to keep a TCP connection open

    hi my firends,
    i met a problem , our project need build an OSB to control a socket service which is able to transfer a big data file (maybe a voice file,*.wav),and the client program will play the voice file on live.
    So my solution is that : keep a socket (tcp) connection open,client listen port and makes date play.
    but i can't make the OSB socket transport alway open,it will timeout after a few second if have none date received.
    how could i deal with it ... pls let me konw if you have any idea...i will wait you on line
    thanks guys

    Hi,
    I'm not sure if that's achievable using OSB, and even if it was, I don't think OSB was designed having this type of application in mind...
    I understand that you need a media streaming solution and I'm pretty sure that there are plenty of tools out there that can help you in doing that, and maybe some of them can be integrated with OSB in some way...
    Cheers,
    Vlad

  • 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

  • Please Help - To keep LDAP connection alive

    Hi,
    I have used the below function to communicate with LDAP which I have taken and modified from one of the posts in this forum.
    My issue is, each time the function opens a connection, search and closing the connection and its seriously affects the performance.
    I hope we can resolve this by keeping the connection alive. As I am new to this concept, I am not sure how to do this.
    It would be great, if some one help me to keep the connection alive for the below function. Thanks in advance.
    create or replace FUNCTION <name> (loginname VARCHAR2)
    RETURN NUMBER
    IS
    -- Adjust as necessary.
    l_ldap_host VARCHAR2(256) := '';
    l_ldap_port VARCHAR2(256) := '';
    l_ldap_user VARCHAR2(256) := '';
    l_ldap_passwd VARCHAR2(256) := '';
    l_ldap_base VARCHAR2(256) := '';
    l_retval PLS_INTEGER;
    l_session DBMS_LDAP.session;
    l_attrs DBMS_LDAP.string_collection;
    l_message DBMS_LDAP.message;
    l_filter varchar2(35):='xxxx='|| loginname;
    l_count NUMBER:=0;
    BEGIN
    -- Choose to raise exceptions.
    DBMS_LDAP.USE_EXCEPTION := TRUE;
    -- Connect to the LDAP server.
    l_session := DBMS_LDAP.init(hostname => l_ldap_host,portnum => l_ldap_port);
    l_retval := DBMS_LDAP.simple_bind_s(ld => l_session,dn => l_ldap_user,passwd => l_ldap_passwd);
    -- Get attribute
    l_attrs(1) := 'xxxx';
    l_retval := DBMS_LDAP.search_s(ld => l_session, base => l_ldap_base, scope => DBMS_LDAP.SCOPE_SUBTREE, filter => l_filter, attrs => l_attrs, attronly => 0, res => l_message);
    l_count:=DBMS_LDAP.count_entries(ld => l_session, msg => l_message);
    -- Disconnect from the LDAP server
    l_retval := DBMS_LDAP.unbind_s(ld => l_session);
    return l_count;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('Error :'||SQLERRM);
    return 0;
    END <fun name>;
    Thanks,
    Praveen
    Edited by: 920577 on Mar 13, 2012 9:40 AM
    Edited by: 920577 on Mar 13, 2012 9:41 AM

    The basic template looks as follows:
    SQL> create or replace package Foo as
      2 
      3  procedure LdapLogoff;
      4  function GetData( empName varchar2 )  return number;
      5 
      6  end;
      7  /
    Package created.
    SQL>
    SQL> create or replace package body Foo as
      2 
      3  isLoggedOn boolean;
      4 
      5  procedure LdapLogon is
      6  begin
      7          DBMS_OUTPUT.put_line( '..running logon()' );
      8          isLoggedOn := true;
      9  end;
    10 
    11  procedure LdapLogoff is
    12  begin
    13          DBMS_OUTPUT.put_line( '..running logoff()' );
    14          isLoggedOn := false;
    15  end;
    16 
    17  function GetData( empName varchar2 ) return number is
    18  begin
    19          if not isLoggedOn then
    20                  LdapLogon();
    21          end if;
    22         
    23          DBMS_OUTPUT.put_line( '..running GetData() for '||empName );
    24          return(
    25                  round(DBMS_RANDOM.Value(1,100))
    26          );
    27  end;
    28 
    29 
    30  --// main()
    31  begin
    32          DBMS_OUTPUT.put_line( 'Package Foo loaded into memory' );
    33          isLoggedOn := false;
    34  end;
    35  /
    Package body created.
    SQL>
    SQL>
    SQL> select empno, ename, Foo.GetData(ename) as ID from emp order by empno;
         EMPNO ENAME              ID
          7369 SMITH              23
          7499 ALLEN              47
          7521 WARD               88
          7566 JONES              71
          7654 MARTIN             91
          7698 BLAKE              28
          7782 CLARK              92
          7788 SCOTT              91
          7839 KING               48
          7844 TURNER             89
          7876 ADAMS              64
          7900 JAMES              16
          7902 FORD               18
          7934 MILLER             35
    14 rows selected.
    Package Foo loaded into memory
    ..running logon()
    ..running GetData() for SMITH
    ..running GetData() for ALLEN
    ..running GetData() for WARD
    ..running GetData() for JONES
    ..running GetData() for MARTIN
    ..running GetData() for BLAKE
    ..running GetData() for CLARK
    ..running GetData() for SCOTT
    ..running GetData() for KING
    ..running GetData() for TURNER
    ..running GetData() for ADAMS
    ..running GetData() for JAMES
    ..running GetData() for FORD
    ..running GetData() for MILLER
    SQL>
    SQL> select empno, ename, Foo.GetData(ename) as ID from emp where rownum = 1;
         EMPNO ENAME              ID
          7369 SMITH               9
    ..running GetData() for SMITH
    SQL>
    // call Foo.Logoff manually when done, or leave it to
    // Oracle to close and release resources when the
    // session terminates

  • 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

Maybe you are looking for