How many Connections objects????

Hi
I am creating a GUI application which contains several GUI classes(e.g. frames and dialog boxes) which are instantiated depending on the choice of the user. I also have a Database class which contains the code which enables the connection to the database. The code creating the connection is within the constructor,therefore creating a connection whever I create an instance of the database class.
Most of the GUI classes need to obtain or update information held in a database.
Currently I create an instance of the Database class in every GUI class which needs to access the database. Obviously however every time a new database object is created, a new connection is also created.
I am worried about all these database objects all containing their own connections.
Should I have just one connection object in existence at any one time?
If so,can I declare the Connection variable in the Database class as static?
Any help/comments would be gratefully received.
LGS

From what I know, there should be no problem with maintaining multiple connections to the database. This is a property of the database itself, most allow about 256 connections. The only problem you face is a lost transaction. As long as you keep the queries serialized, you shouldn't encounter any problems.
If you did want to only have one connection open... why not have another class for that (DBConn) and not instantiate a new connection in the constructor of your Database class. This way, each Database object can use the one connection by all referencing the DBConn object.
Just a thought...

Similar Messages

  • 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

  • "a"+"b"+"c", how many String objects created?

    Hello everyone,
    String s = "a" + "b" +"c";
    How many String objects are created?
    I guess 5, is it right?
    regards

    > How many String objects are created?
    >
    I guess 5, is it right?
    Nope. Just one.

  • How many connections can be supported by FMS2?

    Hi all,
    I have researched the Server.xml file in FMS2. This file
    have property :
    quote:
    <!-- Max connections requests that can be pending.
    Connections will be rejected if queue size limit is reached. -->
    <!-- -1 = default = 1000. -->
    <MaxConnectionQueueSize>-1</MaxConnectionQueueSize>
    Have SO known that how many connections can be supported by
    FMS2 ? ( or maximum is 1000 ? )
    Thanks

    Perhaps this will help:
    http://www.macromedia.com/software/flashmediaserver/productinfo/pricing/
    Lon Hosford
    www.lonhosford.com
    May many happy bits flow your way!
    "hieuu82vn" <[email protected]> wrote in
    message
    news:e2k9g8$hu5$[email protected]..
    Hi all,
    I have researched the Server.xml file in FMS2. This file
    have property
    <!-- Max connections requests that can be pending.
    Connections
    will be rejected if queue size limit is
    reached. -->
    <!-- -1 = default = 1000. -->
    <MaxConnectionQueueSize>-1</MaxConnectionQueueSize>
    Have SO known that how many connections can be supported by
    FMS2 ? ( or
    maximum is 1000 ? )
    Thanks

  • How many connections PAT can handles?

    How many connections that an IP address with PAT can support? One IP address with PAT can support 65536 hosts as there are 65536 ports available for an IP(ranging from 0 to 65535)?

    Hi,
    PAT (overloading) divides the available ports per global IP address into three ranges: "0-511, 512-1023, and 1024-65535". PAT assigns a unique source port for each UDP or TCP session. It will attempt to assign the same port value of the original request, but if the original source port has already been used, it will start scanning from the beginning of the particular port range to find the first available port and will assign it to the conversation.
    Please refer the below URL for details:
    http://www.cisco.com/en/US/products/ps6640/products_qanda_item0900aecd801ba55a.shtml
    I hope it helps.
    Regards,
    Arul

  • How many string objects - please suggest

    Hi there,
    Can you somebody please tell how many String objects will be created when the following method is invoked?
    public String makinStrings() {
    String s = “Fred”;
    s = s + “47”;
    s = s.substring(2, 5);
    s = s.toUpperCase();
    return s.toString();
    Thanks
    Shan

    Hi VShan,
    This is your code
    public String makinStrings() {
    String s = “Fred”;     //1
    s = s + “47”;            //2
    s = s.substring(2, 5);//3
    s = s.toUpperCase(); //4
    return s.toString();     //5
    EXPLANATION : String is an immutable object, that means the String object cannot change it's contents.It might sound very unfamiliar but it is TRUE. In line 1: You declare a String object by assigning a a String literal "Fred" to the variable s. Now when you concat "47" with the original contents of s , a new memory space is allocated where s is assigned.+It is important to note+ that the previous reference of s i.e. "Fred" will be lost and now s refers to a new memory location where the contents are "Fred47" , so you have created another object in Line 2. Similarly you create another object in line3 & 4.As far my calculations you have created 4 objects.
    I would like you to kindly note that s is already a String so you can directly return s and hence there is no need of s.toString() in Line 5.You should also note that each object is also an eligible candidate for Grabage Collection.
    So as soon as Line2 gets executed , the object in Line1 becomes eligible for garbage collection.. that means when GC runs that object will be reclaimed and hence memory will be freed.

  • Sql Server 2012 Evaluation - How many connection allowed ?

    Hi all
    I'm testing the replication, everything Works fine, but I'd like to know how many connections allow the evaluation of the SQL Server versión I'm testing on.
    We are testing 2 stores with 2 server in replica with about 20 users in each side. So we can get an idea of the prices of the licences my customer have to buy.
    Thank you very much.
    James Smiths

    SQL 2012 license usually is per core and/or per CAL and it depends on the edition.
    All editions don't impose any limit on connections but rather on maximum memory, CPUs and other features.
    You need first to decide which SQL version suits your needs (and your hardware) and then call for suggestions and prices.
    http://www.mssqltips.com/sqlservertip/2942/understanding-the-sql-server-2012-licensing-model/
    http://www.microsoft.com/en-us/server-cloud/products/sql-server/buy.aspx
    "If there's nothing wrong with me, maybe there's something wrong with the universe!"

  • How many view object instances can create from Single Entity ?

    Hi All,
    JDev Ver : 11.1.1.5
    I want to How Many view objects can i create from the single entitiy ?
    Is there any limit ?
    Thanks,
    Gopinath

    No, there is no limit

  • How many connection ?

    HI,
    Is there any way to find how many connections are happened to ORACLE 10g database (OS- AIX) for past 30 mins or selected time frame.
    The db having 30 mins snap interval.
    Thanks in advance,
    Govin.

    Dear sb92075 ,
    Thanks for your reply,
    I just want to double check from you.
    As per below log, The db has 2 connection @ 04:47:59 and 1 connection @ 04:48:23 am i right???
    20-OCT-2010 04:47:59 * (CONNECT_DATA=(SID=xxtest)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))) * (ADDRESS=(PROTOCOL=tcp)(HOST=000.000.00.000)(PORT=61560)) * establ
    ish * xxtest * 0
    20-OCT-2010 04:47:59 * (CONNECT_DATA=(SID=xxtest)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))) * (ADDRESS=(PROTOCOL=tcp)(HOST=000.000.00.000)(PORT=61563)) * establ
    ish * xxtest * 0
    20-OCT-2010 04:48:23 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=test2)(USER=oracle))(COMMAND=status)(ARGUMENTS=64)(SERVICE=lsnr_xxtest)(VERSION=169870336)) * status
    * 0
    Thanks Govin

  • How many connections supports a web interface with each camera and how many Adobe Encoder clients does AMS support? AMS Standart

    How many connections supports a web interface with each camera and how many Adobe Encoder clients does AMS support? AMS Standart. We need connect by  Adobe Encoder many people. what is differences between Adobe Media Server 5 Professional, Adobe Media Server 5 Standard and Adobe Media Server 5 Extended?

    For the detailed list of differences across editions refer this link
    http://www.adobe.com/in/products/adobe-media-server-family/buying-guide-comparison.html

  • How many connection of BW

    Hi gurus,
      I have a doubt , how many BW connection is possible for one r/3 source system.
      Thanks

    hi Akash,
    check Note 775568 - Two and more BW systems against one OLTP system
    hope this helps.
    Summary
    Symptom
    Several BW systems are loading data from an OLTP system: Can problems occur during the delta upload?
    Other terms
    Delta request; Delta queue; RSA7; Time stamp
    Reason and Prerequisites
    No documentation exists.
    Solution
    This note replaces the documentation where it is not yet available.
    The delta queue always supports multiple BW connections to an OLTP system. The DataSources that use the delta queue function to process their deltas are not problematic, even if multiple BW systems send their delta initialization and delta requests in parallel. This affects most OLTP applications, for example, the logistic cockpit, HR, EC-CS, EC-PCA, CRM, SRM, utilities and so on.
    Caution:
    The "Several BW systems at one OLTP system" function is not generally supported for the "old" LIS DataSources that are generated on the basis of the LIS information structures. The delta mechanism for these DataSources only provides for one BW system. However, since these DataSources have been almost completely replaced by the cockpit logistics functions, the risk to customers who are just about to plan their BW projects is minimal to non-existent.
    However, there is a problem for customers using DataSources with their own time stamp administration.
    The problem is restricted to extractors that determine the delta directly via a time stamp during the extraction (for example, CO-OM, FI-AR, FI-AP, FI-GL, CO-PA up to and including PI 2003.1, CFM, CML, generic delta using a time stamp). In this case, currently extracted records are technically sent to the requesting BW on the one hand, and on the other hand, written to the delta queue (RSA7) for a possibly required repeat and even for the deltas of other BW systems. The new time stamp that is then set is used during the extraction for the next delta. If this takes place from a second BW, the process described above is run again, but an additional selection is made according to existing records in the SAPI delta queue that this BW has not yet retrieved. The problem with the second initialization for this type of extractor occurs at this point:
    If delta initialization requests run from several BW systems in parallel, the time stamp pointer of the delta administration that is set at the end of the first delta initialization is overwritten by the second one. This may result in data that was already extracted in the delta initialization appearing in the subsequent delta from the first BW system.
    The problem occurs with chronologically overlapping delta initialization requests. These problems may also occur with overlapping delta initializations from two BW systems.
    With two parallel deltas, duplicate records can appear in the worst cases: If two BWs request delta simultaneously, the time stamps for the upper limit of the selection are taken without the system being aware of the other extraction. However, this is unproblematic as long as the goal is an ODS object with a MOVE update.
    To avoid the danger of possible data inconsistencies, complete the Init run from a BW system BEFORE you start an Init or delta run from the other BW system.  That is, check on the monitor that the status of the delta Init request is green before you request an Init request from the other BW system. A lock mechanism is provided for CO-OM and is described in note 736394. The other applications mentioned here are currently working on a permanent and satisfactory solution.

  • How to determine:how many connections will be needed in RFC adapter setting

    Hi XI guru,
    We are working on following secnario:
    1. JDBC sender selects data from Oracle database, and send this data to SAP XI, XI use async RFC receiver adapter to call a self made RFC, in this RFC, we will call some BAPI and process some ABAP code, then if the reture code is ok, nothing will happen( means data successfully import into SAP ). if the reture code is not ok, another RFC will be called from ABAP code, send an asyn message to XI, XI use RFC receiver to update the message back to Oracle with specific flag.
    2. Why we use this secnario is, we want to avoid using BPM, this scenario are mass happening in our project, BPM will slow down the performance.
    3. We also don't want to use sync RFC, because BAPI and ABAP code will take sometime to run, we don;t want XI want for the RFC reture message.
    The question is:
    We successfully run this secnario in unit testing, but when we work on stress testing,found some times we will miss the RFC call. For example:JDBC sender sends message to XI for 10 times in a very short time( we use fault data to make  every message has a send back RFC message in stress testing), let's say poll interval 5 sec one time. but send back RFC only be called 7 or 8 times, 2-3 message were missing.
    we get back to SXMB_MONI, see all JDBC sender 10 message are successful, and 7- 8 send back RFC messages also successful. No log in SM58 RFC monitor. Then we go to modify maximum connection, and set it to 5, means 5 RFC coconnection possible(as far as I know, this setting means like this, but of course I maybe wrong)
    Question is: how can I know how many coconnections I need to setup, and if some RFC calls are missing, is there any place whatever in XI or R/3 can help me to monitor the log, then I can know they are not successful for some reasons,but not just simply miss as they never happened?
    That will be helpful, if some one can tell the story of what happen RFC works at background.
    Thank you very much for your time and effort on this

    HI,
    Maximum possible number of initial connections required between sender system and adapter. This value is limited internally to a maximum of 50
    See the below links
    http://help.sap.com/saphelp_nw2004s/helpdata/en/67/6d0540ba5ee569e10000000a155106/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/33/c6e63b60c25767e10000000a11402f/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/a4/db833d4c47ea4ea1a9b7af3c535ff2/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/6e/3f560a3e0f6f4a90fb1e7db1388d4d/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/25/90d038f58f863de10000000a11402f/frameset.htm
    /people/swaroopa.vishwanath/blog/2005/03/11/rfc-migration-to-bapi-in-r3--step-by-step
    Regards
    Chilla

  • How many connections?

    Just a quick planning question. This is a church environment that may grow quickly. They're currently trialing with three LinkSys devices and about 25 users. But they anticipate up to a couple of hundred users if successful. Which device(s) would be best for lots of connections? And how many would that be per access point?

    The absolute answer is "It Depends" ... just like any other size or implementation question.
    For commercial APs from Cisco, the closest thing to "rule of thumb" is ~20 concurrent users per AP, but that number can be adjusted up or down depending on the application, protocols in-use, and overall volume of traffic per user. Also keep in mind that ONE USER radiating an 802.11b signal into your coverage will (may) slow down the system and reduce the potential max count.
    I would also humbly suggest you dump the Linksys and go with commercial APs, as they will have more options for fine tuning the power, coverage, rogue mitigation, monitoring, and control.
    How many do you need? From the information provided, I'd say 500 or so. You can probably adjust that down somewhat according to the size of the coverage area, building materials, and a mess of other parameters ... without that info, I'll go safe and say 500 ( ;-} .
    i.e., How many vehicles do I need to transport the entire senior class of my nephew's high school class at one time? We need to create a solid transportation budget.
    Realistically, what you need is a solid site survey that will measure a real signal in the actual environment with real or simulated traffic that is comparable to the expected loads. There is no substitute.
    If you are not prepared to do that kind of survey, you should hire someone to come in and do it for you, as this is *critical* information and can save you a mess of money (frustration, reputation) in the long run.
    The site survey is where the budget meets head-on with the requested functionality. If you already have a budget planned, then expect to lose some functionality or coverage.
    If you already have desires and expectations, then the site survey will provide you the information needed to come up with a reasonable and realistic budget.
    As a final note: Just kidding on 500 (in case your sense of humor was broken). A proper spread of APs with the proper antennas can accommodate almost anything ... proper antennas for the coverage area is critical, and selection of same is a big part of the site survey.
    Good Luck
    Scott

  • How many connections can  make to FMS ?

    I want to install Adobe Media Encoder on 40 separate machines, and AMS on another machine.
    Each machine has 4-5 webcams connected.
    So, I have a web-aplication where users log-in and watch thewebcam they want. My question: how many machines can I connect to one server?(how many Adobe Encoder clients does AMS support?)
    Thank You

    You can have 10 RTMP connections to AMS 5 trial version. See the below link for more details:
    http://www.adobe.com/in/products/adobe-media-server-family/buying-guide-comparison.html

  • MaxActive?? how many connections should be made available

    Can anyone recommend what I should set the maxActive="" property of my database resource connection for a medium to large scale ecommerce application.
    How many simultaneous database connections might I expect?
    I know this is dependant on the volume of traffic on the site, but I just need a general Idea, I currently have maxActive="100", but I'm a little worried that this may be insufficent for a site that may have up to 5000 concurrent users.
    Thanks in advance.

    Do you have a formula for the above, to give an
    estimated requirement for maxActive connection
    settings?
    Sorry! there is no real formula but since you are working on a web application the number of connections used will be close to the number of requests at a time on your web application.
    And the number of concurrent users dosent give much idear about the number of concurrent requests becouse users dont keep clicking all the time. Most of the time they will be reading somthing on the browser.
    Here is a simple calculation but only accurate if you assume that server takes 1sec to process each request.
    If the number of concurrent users is 5000 and each user makes a click once in every 60secs, then there will be aproximatly 5000/60 requests/sec. That is 83.333... requests
    I assume the only warning sign I will get when
    maxActive is reached will be browsers 'hanging' until
    it either times out or a connection is released to
    the pool?Browsers normally times out and display an error if the server do not respond within a predefined interval (Normaly 90secs) thats what you should watch out for.
    By the way if what you want is to make sure the maximum is never reached just set it to a negative value.(Assuming that you are using apache commons pool. negative means infinity)
    And set reasonable numbers to MaxIdle, MinEvictableIdleTimeMillis, and TimeBetweenEvictionRunsMillis. Please read the documentation of the setter methods of above attributes if you dont know what above attributes are for.
    you can also add a back end page to your web application to display the staticstics of the pool.
    such as the number of current idle connections, current active connection and ect...

Maybe you are looking for

  • Problem importing video to iTunes

    So I have an entire season of a TV show that I've actually had on iTunes before and I've been able to put in some of the episodes but not all of them...I was wondering if there might be something in my settings that is preventing them from being adde

  • How can I improve performance over a Branch Office IPsec vpn tunnel between and SA540 and an SA520

    Hello, I just deployed one Cisco SA540 and three SA520s. The SA540 is at the Main Site. The three SA520s are the the spoke sites. Main Site: Downstream Speed: 32 Mbps Upstream Speed: 9.4 Mbps Spoke Site#1: Downstream Speed: 3.6 Mbps Upstream Speed: 7

  • How to install swagbucks on firefox

    I have installed Firefox as my default browser. I have attempted to download Swagbucks toolbar but will not download. Swagbucks toolbar download has Firefox plug-in available. When I attempt to use plug-in, I am informed this engine already exist. A

  • Switch usage reports to reflect public site on iTunes U?

    Our school started with a private iTunes U channel, then we converted it and went public (Thunderbird School of Global Management). All my usage reports are coming to me with 0 views. I think it is still giving me stats from the private site, which i

  • HELP! imovie 08 unknown answer

    OMG! I spent the last 2 days getting a 20 minute short film together for a due date of tomorrow(!) in the Atlanta Film Fest. Everything went reasonably well till I tried to republish. Window drops in saying can't publish due to error code 108. Help m