Where should I create the DataSource ?

I have an application which uses the Tomcat Connection Pooling.
Its running fine with the following code:
DataSource dataSource = (DataSource) envCtx.lookup(contextName);
conn = dataSource.getConnection();
My First Question: If it really a connection-pooling happening here bcoz I am creating DataSource object for each request ??
But After reading the DataSource documentation I found that this is a same as DriverManager so It seems I shouldn't do it for each request and I need to create DataSource object once and that object should be used by each request..
Please clarify me If I am wrong and I can use my existing code.
Rgds,
- Amit

I would do it for each request. i like to use database resources in the narrowest scope possible, preferrably method scope. that way i get a connection, get what i want, and return it to the pool for someone else to use. it's more scalable that way, imo. the connection pool amortizes the cost of creating all those connections.
%

Similar Messages

  • Where should i call the rfc function module? in xi or in r/3

    where should i call the rfc function module?
    for the synch scenario: file < -- >  xi <---> rfc
    i know the type of rfc is tcp/ip; but i'm not sure with the followings,
    and with some trials i can not even see any message via rwb even all the setting
    can be activated without errors.
    where should i create the rfc destination? in r/3 or xi
    where should i call the rfc via abap program? in r/3 or xi
    i guess the calling program should belong to the different server with the rfc itself....
    so confused....
    Thanks for your reply!!
    Jun

    if i create the destination in xi point to r/3, then i call the rfc use the destination in r/3 right ?
    The call doesnt use the destination in R3. XI has the RFC destination which is just used to connect to the R3 system
    but where i need to create the fm via se37? in xi or r/3 ?
    In R3
    Regards,
    Prateek

  • Where should I have the create table

    I am making an application which it has a customer, an order and a food objects.
    I know that I can do it in one class (which will have main inside) but I am trying to make it as object oriented..
    so.. I have to make a class for a customer, a class for food, and I will handle all this in another class which will have main method..
    am I right up to here??
    if yes I was now wondering where should I have the sql statment about creating the table.. my thought is to have it at the constructor so when I will make a customer object the table will be created..
    then I will have an add_data(d1,d2,d3,d4....) method where I will insert the data to my database for each customer.. actually only one time I will make a customer object from main and then through this I will call add_data() method to add customers to my database..
    Am i thinking right or I am too far away from what I must do...?
    Thx

    Doesn't particularily matter given that the application is small.
    However in larger applications the database is created outside of the application usually using a SQL script.

  • Where should i put the DEFAULT&SMARTBAR

    Hello,
    where should i put the DEFAULT&SMARTBAR ? and the main Menu ?
    in order to be shown in each form..
    in using Forms 6i.
    Regards,
    Abdetu..

    Hello Gerd,
    Thanks for reply..
    put such things into *a reference form* what is meant by a reference form do u mean the main form?
    Create a property class (PC) for your FORM-MODULE-properties,
    put this PC into the reference form.
    Create there an object group (OG), put the PC into the OG and the inherit the OG to your local form.
    Automatically you have then the PC inherited too.i did all what u mentioned..
    Bbut the problem is that the DEFAULT&SMARTBAR
    can't be seen in allllllllllll my forms in the main menu inspite of i put it into the form module property ->in the intial menu property.
    Regards,
    Abdetu..

  • Where should I save the camera calibration profile for Lightroom 2?

    I created some DNG Camera Profiles by DNG Profile Editor. For Camera Calibration in Camera Raw, I save those .dcp files in C:\ Administrator\ Documents and Settings\ Application Data\ Adobe\ Camera Raw \ CameraProfiles. However, I could't find such a subfolder in Lightroom folder, does any one know where should I save the dcp files for Lightroom 2? Thank you

    It's the same install folder for both Camera Raw and Lightroom (i.e., a .dcp installed in the folder you described will be readable by both CR and LR).
    Eric

  • Maintaining/Creating the datasource 2lis_03_bf/2lis_03_um

    Hi all - in our environment(r/3) someone had already created the datasources 2lis_03_bf/2lis_03_um but I want to create them again.  The process I am following is
    1.  "Inactivate" the Update for datasource 2lis_03_bf/2lis_03_um in LBWE
    2.  Delete data in set up table (LBWG)
    3.  Delete data in delta queue (RSA7)
    4.  Maintain the datasource in LBWE by clicking on the Maintainance link.  Select all the required fields.
    After selecting the required fields and clicking 'OK', I get a msg saying "Do you really want to confirm the entries" and when I click ok, I am getting the below error message...
    <b>"Entries for application 03 still exist in the extraction queue ->"</b>
    Please let me know.
    thanks,
    Sabrina.

    Hello Sabrina,
    Go to transaction LBWE, click on "Job Control" corresponding to your application area. You will get a pop up window from where you can run the job.
    If you are in test phase and don't need the data which is there in LBWQ, you can simply delete that entry from LBWQ and proceed.
    SM13 will take you the extraction queue if you are using "Unserialized V3 update". If you are using "Queued delta", then LBWQ is the place to check extraction queue.
    Please assign points if you found it helpful.
    Regards,
    Praveen

  • Where Should I Set the Layer Break Marker?

    I am burning to a Memorex DVD+R DL media------
    I received this error message when burning:
    "Formatting was not successful. Layer 0 exceeds the
    maximum layer size allowed. Please choose a suitable
    marker location that will support this condition."
    I placed one approx halfway through my main sequence, which
    is a total of 4.6 GB, but I am still receiving this message.
    Where should I place the marker so I can successfully output?
    My total project is about 6.2 GB.

    So you are telling me that I could delete the DNS from each machine and set it in either the new modem or Time Capsule router.
    That is correct!
    I guess what I'm confused at is what device is doing what.
    Let's look at a few examples, hopefully to help understand where all these protocols/services (PPPoE, DNS, & DHCP) come into play:
    Scenario 1: Modem > Computer
    In this scenario, your ISP provides the DNS server IP address information to your computer via DHCP. DHCP also provides the other important IP address information: IPv4 address, subnet mask, & router IP to your computer in order to communicate on the Internet.
    Since your DSL ISP requires that you are authorized to access their Internet service, they utilize PPPoE to pass your account credentials (username & password) from your computer to their authorization server. Once verified, you are granted access.
    Scenario 2: Modem > Router (Actiontec) > Computer
    In this scenario, your Actiontec router provides your account credential (via PPPoE) to the ISP and also acts as a DHCP server. As a DHCP server, it provides your computer with the required IP addresses and passes on the ISP's DNS IP addresses as well. You do have an option with this router to enter a different set of DNS IP addresses ... like those for Google DNS or OpenDNS if you do NOT want to use the ISP's DNS servers. In this case, the Actiontec, uses its DHCP server to provide those addresses to your computer.
    Scenario 3: Modem > Upstream Router (Actiontec) > Downstream Router (TC) > Computer
    Since you have the TC configured as a bridge, it is basically a "pass-through" device. That is, the Actiontec will continue to provide the IP addresses just like in Scenario 2 "through" the TC so that wired or wireless clients connected to the TC get the addresses. Also, like in Scenario 2, you can assign DNS IP addresses on the TC ... and these would be provided to clients connected to it.

  • How Can i create the Datasource

    Hi All,
    Can anybody guide me how to create the Datasource.
    Thanks in Advance
    regards
    Priyanka

    Hi Priyanka,
    You can Create DataSource for Different Source systems.
    Chech these URLs.
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/01ed2fe3811a77e10000000a422035/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/00153831035167e10000000a1553f6/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/42/fdccb72aa95277e10000000a1553f7/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/93dbdbff0b274ee10000000a422035/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/03b1f4dc636e72e10000000a422035/content.htm
    Hope it helps.
    Thanks,
    -Vijay

  • Where should I change the adapter? It doesn't work from the start.

    where should I change the adapter? It doesn't work from the start. But there is no apple store in our city.

    The phone does not charge when linking with adaptor. But it is OK when linking PC using USB instead. I do not know why, but I am just sure there is something wrong with the adaptor.

  • Where should I put the sevlet

    I just started to work with Tomcat and I compiled the helloWorld sevlet.
    It's said from a book that the sevlet should be placed in serlver_root/webapps/ROOT/WEB-INF/classes, however there isn't a "classes" folder in my WEB-INF folder. So I put the helloWorld sevlet in the WEB-INF folder.
    Then I type http://localhost:8080/servlet/helloworld in my browser, I get a message from the sever said "The requested resource (/servlet/HelloWorld) is not available".
    Could anybody tell me how can solve this prolbem, where should I put the sevelt?

    have ones more a look to your book - especially to information about the configuration file "web.xml" which also should be placed in the WEB-INF folder. This file defines which servlets should be found by the server and which request-URL should be mapped to this servlet.
    for examples concerning the web.xml file see those already defined in your server. copy one and edit it for your needs. if you really want to understand what else might be configured using web.xml see the DTD for this file - it's pretty good documented!
    hope it helps :)

  • Where Should I put the time capsule?

    Where Should I put the time capsule?
    I'm using a wireless modem/router provided by the internet company, and both (the TC and the router) are located next to the pc, in the living room . Using this way, I don't have signal in my bedroom. Should I get a signal amplifier?
    Thanks!

    It would be better to use EOP adapters (homeplug is another name) or ethernet to locate the TC closer to your room.. you can use another apple router to extend the wireless if you need to.

  • Where should I store the collatoral files that are associated with photos stored in lightroom?

    Where should I store the collatoral files that are associated with photos stored in lightroom? Items such as pdf files, word documents, etc. How should I connect them to each other so I can find both the photo and the related data?

    Lightroom itself will not help you with pdf, word, etc.
    However, there is a plugin you can use called AnyFile which will allow you to manage these documents in Lightroom (by assigning keywords and other metadata) so that you can search for all documents (photos, pdf, word, music, powerpoint, etc.) with given metadata.
    Because you do this via metadata, it doesn't matter where you put these files. Put them anywhere you want.

  • HT201301 where should i save the files to, in order to acces them

    where should i save the files to, in order to acces them

    What files?
    To access from where?
    Please explain

  • Where should i fire the plug within the webdynpro component

    when the search don't match for the url parameters passed in my scenario, i need to display the error view page, so wanted to know where should i fire the plug within the webdynpro component. could some one guide plz.
    thanks n regards
    Anoop

    You can go for event handling. In the component controller, just fire an event that there is a search mismatch. Handle this event in your view, where you just fire the outbound plug.
    Or, since you get the parameters in the url itself, instead of having 2 views, you can do it in one view itself by displaying only an error message when there is no record matching the query. If there are records, make the search results visible. Just have a context attribute to manipulate the visibility. This can be done with the comp controller itself, without any events.
    Regards
    Nithya

  • Where should i select the single catridge mode

    where should i select the single catridge mode

    Hi bharathipl, welcome to the HP Forums. What is the model or product number? What version of Windows is installed?
    Guide to finding your product number
    Which Windows operating system am I running?
    TwoPointOh
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom to say “Thanks” for helping!

Maybe you are looking for