About putting conenction object in session

Hi,
iam having an application with jsps.i need to connect databse multiple times.so far iam doing in this way..the first time when i connect to database then iam putting that connetion object in session and using whereve i require..but i have i doubt wther this is good practice are not.
please advise me on this.are i have to connect to database in each page and close the connection once the operation is finished..which one is best way..

worst is to keep connection in a session, this willr esult in alot of open connection not being used.
Better is to create and close a connection each time youneed one
Best is to use a Connection pool.

Similar Messages

  • Add Tags to Document tool put one object behind another or just deletes page content?

    Using Acrobat XI Pro to make documents 508 compliant PDF. I've had a number of issues went using Add Tags to document option, it’s put one object behind another or deleting it all together. Also had issues when trying to adjust the reading order, content is moved or deleted. This PDF is created from InDesing CS5
    Anybody know what I'm talking about or have any ideas about how to fix it? Thank

    Content should not ever be deleted by adding tags, but it may appear so since - as you note - objects may go into hiding behind other objects. In theory you can bring them out of hiding by rearrange things in the Order pane, but I have much better luck using the Content pane - it provides a much finer level of control. If text is hidden behind a shaded box, for example, I will move the box above the text in the Content order, then usually convert the box to an artifact if it is not one already.
    Hope this helps.
    a 'C' student

  • Doubt about Tunning View Objects

    Hi !. I have the following doubt about tunning View Objects:
    If I have the following configuration on a VO:
    All Rows
    In Batches Of: 11
    As Needed
    Access Mode: Scrollable
    Range Size: 10
    Total Records On The Table: More than 100
    What would happen is that while the initial render, the view cache is fetch with 11 rows from the table and the ui table shows 10. In subsequent scroll events, more queries again will be done but not when the user scrolls back. My doubt is this one: Why, while the initial render If I put a breakpoint in this overrided method executeQueryForCollection, the execution reachs there but in subsequent scroll events (forward) the execution doesn't reach there ?. I understand thast this should happen as the required rows are not yet in the cache. I would like to know a way to test this access mode and what method is executed in every roundtrip to the DB. Thankx !.

    I don't think ADF needs to execute the query again - it just needs to fetch the next set of records.
    So if the cursor is already open, no need to issue another query.
    You can use the HTTP Analyzer to watch network traffic
    Monitoring ADF Pages Round-Trips with the HTTP Analyzer
    And you can use the logging features of ADF to see the queries being executed.
    Declarative View Objects (VOs) for better ADF performance

  • How to obtain a session object from session id

    Hi all,
    let say that I have a list of session ids, and I want by scheduald task to check whether the session is alive\active.
    I saw that the HttpSessionContext was deprecated. (see: http://javasolution.blogspot.com/2007/08/getting-session-object-using-session-id.html)
    Is there any other way to check if the session is alive?

    Do it the other way: let the session itself notify that it is not alive anymore.
    Implement a HttpSessionListener which adds the session to list/set/map on create and removes the session from it on destroy, register it in the web.xml and run it.

  • How to remove an object from session with JSF 2.0 + Faceletes

    hi all,
    I have a facelets page which calls a backing bean of session scope. Now when ever i click on this page i want the existing bean object to be removed from the session . In my existing jsp i have a logic something like this to remove the object from session
         <% if (request.getParameter("newid") != null) {
              request.getSession().removeAttribute("manageuserscontroller");
    %>
    Now i have to refactor my jsp to use facelets and i should not be using scriplets anymore . I did try with JSTL but the <c:remove> tag is not supported by facelets.
    Can someone help me how can i refactor this code to work for my facelets?
    I really appreciate your help in advance
    Thank you

    r035198x wrote:
    Redesign things so that the remove is done in a backing bean method rather than in a view page.Exactly that. I tend to cleanup session variables at the start and at the end of a page flow; generally the end is some sort of save or cancel action being invoked through a button but that is application specific.

  • I am so frustrated.  I put ab object and/or a text box on a page and then cannot select it - the Text cursor (not pointer) is put on the object or text box and nothing happens.  It is so frustrating!  I then open up Everweb and the same thing,

    I put an object and/or a text box on a page and then cannot select it - the Text cursor (not pointer, just the text cursor shows) is put on the object or text box and nothing happens.  It is so frustrating!  I then open up Everweb and the same thing, I create an object and then try and elect it to make it bigger etc and cannot.  I know it must be something system wide as it happens in apps other than Pages.

    I put an object and/or a text box on a page and then cannot select it - the Text cursor (not pointer, just the text cursor shows) is put on the object or text box and nothing happens.  It is so frustrating!  I then open up Everweb and the same thing, I create an object and then try and elect it to make it bigger etc and cannot.  I know it must be something system wide as it happens in apps other than Pages.

  • Putting a object on the coherence cache

    Hi All,
    Is there a better way of doing the following:
    In a multi-threaded region of code I perform the following sequence of steps:
    1. Use a filter to check if object foo already exists on the cache.
    2. if the result set of the filter is null, I perform a lock Cache.lock(foo.getUniqueID);
    3. I put the object foo on the cache Cache.put(foo);
    Basically I am trying to avoid another thread from overwriting the existing cache object.
    Is there a better way to achieve this ?
    regards,
    Ankit

    Hi Ankit,
    You can use a ConditionalPut EntryProcessor http://docs.oracle.com/cd/E24290_01/coh.371/e22843/toc.htm
    Filter filter = new NotFilter(PresentFilter.INSTANCE);
    cache.invoke(foo.getUniqueID(), new ConditionalPut(filter, foo));An EntryProcessor will take out an implicit lock on the key so no other EntryProcessor can execute on the same key at the same time. The ConditionalPut will apply the specified Filter to the entry (in this case to check that it is not present, and if this evaluates to true then will set the specified value.
    JK

  • About authority-check object 'M_MATE_WGR'

    hi all
          I have a problem about authority-check object 'M_MATE_WGR'. the detail is bleow:
    Read table T023 where the material group is in select option s_matkl. Then loop at the results and check for every found material group. If the user is authorized to use it with the ABAP statement AUTHORITY-CHECK with object M_MATE_WGR with parameters ACTVT = ‘03’ (display) and BEGRU = ‘the material group’. When the user is allowed to use it, store it in an internal table and continue with the remaining materials groups from T023. When the user is not allowed to use it, set the status flag to X and don’t save the current material group in the internal table.
    After all checks have been done, empty the select option s_matkl. Loop over the internal table with the allowed material groups and fill up the select option s_matkl again with these records.
    Thank you in advance .
    Nick

    You are on the right track. Authorization object M_MATE_WGR checks the Authorization Group (BEGRU) not the Material Group. You read table T023 with the Material Group to get the Authorization Group.
    Step 1: Read table T023 where MATKL = the Material Group you want to check authorization.
    Step 2: Retreive the value in field BEGRU from the record in table T023. Use the value in T023-BEGRU to pass to the AUTHORITY-CHECK object M_MATE_WGR.
    Hope that helps.

  • Docs about RowSet, and Object RowSet questions?

    Docs about RowSet, and Object RowSet questions?
    I can find RowSet forum, so I ask here!
    Can you give me URLs where I can find more about RowSet and URLs for any RowSet implementation?
    Does Borlans, Oracle, IBM, etc., have RowSet implementation?
    I find out about Sun's RowSet implementation, but I can't find Object Rowset in this implementation?
    Is it possible to develop Object RowSet and is it useful?
    I know about O/R tools like Hibernate, but Object RowSet can be useful?
    Run SQL query and get Objects, or maybe even run Object query (like EJB or Hibernate or JDO have) and get Objects.
    No XML mapping mess and simmilar, like with EJB or Hibernate or JDO?

    You can try
    http://java.sun.com/developer/Books/JDBCTutorial/chapter5.html
    This is a tutorail for RowSet

  • How do we put an object in coherence cache when the pk is using @TableGener

    Hi,
    I am trying to create a sample application using Spring, JPA, Eclipselink, Coherence. I am trying to insert objects into cache and then expecting it to persist into database asynchronously. The issue is we are using @TableGenerator to generate pk. I dont have the primary key before hand to use it to put the object into the cache.
    Ex: cache.put(???, object);
    What is the best approach in such scenarios. Can anyone point me to an example?
    Thanks.

    user12107940 wrote:
    The above article helps but we can't change the current architecture of generating the primary key i.e., TableGenerator. We have other non-java processes that update the database. Is there any other way to use jpa-eclipselink to know the pk before persisting the object.In this case you have to ensure that anything which comes via Coherence gets ids from a set of possible ids which is distinct from the set of possible ids generated in the database, but it is technically impossible to put something in a cache without an id already generated if the id is part of the primary key (and you want it to be).
    E.g. whatever generates ids in the database must only generate odd numbers for ids (e.g. a sequence which increases not with one but with two), and whatever goes via JPA/EclipseLink must only generate even numbers.
    Best regards,
    Robert

  • Different change request about the same object

    Hi Gurus,
    I have some doubts about CR (change request) from one system to another, such as from development system to quality or quality to production.
    If I have 2 or more CUSTOMIZING CR about the same object Can I say that they are however identical (they contain the same information)?
    For example on the customizing table:
    record1 contains value 'A' --> CR number 1 is opened
    record1 contains value 'B' --> CR number 2 is opened
    If now I transport CR number 1 I transport value 'B'. 
    And the same if I transport CR number 2.
    Is it correct? Both CR points to the actual value of the record?
    Instead if I have 2 or more WORKBENCH CR I know they "remember" the history of the modifications:
    For example on a program with only 1 istruction:
    data: x.
    --> CR number 1
    data: x,y.
    --> CR number 2
    What happen If I transport the 2 CR simultaneously (selecting both from STMS) ?
    What will be the result in quality/production system? Which CR "wins"?
    Thanks in advance
    Guido

    At time of release from DEV, the current object version or table content is written into the transport data file, thus "detached" from further changes in DEV.
    Now if two transport requests 1 and 2 contain the same object in two versions (older and newer) and are being imported into QA, the following scenarios are possible:
    - 1 is imported first, then 2: newer version will be in QA -> OK
    - 2 is imported first, then 1: older version will be in QA -> not OK
    - both are imported at same time: newer version will be in QA -> OK (STMS checks when the requests were added to the import queue and sorts accordingly)
    Thomas

  • How do i put an object into a HashMap

    Hey
    Im trying to put my object car into my HashMap where the licenseplate is the key, what am i doing wrong?
    Here is my code:
    import java.util.HashMap;
    import java.util.Iterator;
    public class getCar
        private Car car;
        private HashMap<String, String> cars;
        public getCar()
            cars = new HashMap<String, String>();
        public void enterNewCar(int date, String licensePlate, String ownerName, String ownerStreet, String ownerCity,
        String carMake, String carModel, int carWeight, String fuelType, int numberOfSeats)
            car = new Car(date, licensePlate, ownerName, ownerStreet, ownerCity, carMake, carModel, carWeight,
            fuelType, numberOfSeats);
            cars.put(licensePlate, car);
    }

    {color:#000080}Shouldn't
    private HashMap<String, String> cars;be
    private HashMap<String, Car> cars;?
    db{color}

  • How would i go about putting itunes onto a second iphone

    how would i go about putting itunes onto a second iphone

    Settings > General > Reset> Erase all content and settings
    Message was edited by: gdgmacguy

  • How do I go about putting a "restriction" on my adobe software?

    How do I go about putting a "restriction" on my adobe software? Meaning someone would need to sign in to use it. Sign in with a password and/or username. I signed off my adobe creative cloud yet it still allowed me to freely access a program like Photoshop cs6 freely without any restriction.
    I have a creative cloud membership, its just when I first got it it gave me the cs6 software for 20 a month b/c CC was not around yet.
    I hope this question is appropriate for this forum.

    There is no such thing. If you don't want others to use your software, you have to manage your system's users and their permissions.
    Mylenium

  • How to find the bapi about Activities business object...

    Hi All
    can you tell me about information about Activities business object
    iam using SAP CRM..

    Hi KP,
       can you tell us the name of the transaction in which you saw this field?
    If it is in PO Creation or Change you can probably look at the bapis
    BAPI_PO_CREATE or BAPI_PO_CHANGE
    Regards,
    Ravi

Maybe you are looking for

  • Can't Export Video from Final Cut Pro

    After updated to OS Maverick, I can no longer export video from Final Cut Pro. It pops up "The operation couldn't be completed. (com.apple.Compressor.CompressorKit.ErrorDomain error -1.)" ANYONE CAN HELP??

  • When i try to activate iphone it continues to say it is the wrong password

    I did a factory reset and update on my iPhone 4 when I went to activate my phone will not accept my password please help

  • Managing Multiple iPads for Education System

    What is the best solution to managing (charging, purchasing/installing apps, updates, etc) a set of 80-100 iPads?  This is for a school system where the schools are located throughout the state at approximately 27 different sites.

  • IPhone 3G frozen when I tried to upgrade to 3.1.2

    This is not the first time my iPhone 3G gets frozen and unresponsive when upgrading. Two months ago, when I bought it second-hand, I've tried to upgrade from 3.0.1 to 3.1 and it was a nightmare that lasted for days... Eventually I succeeded, after co

  • Firewire working USB not working, not showing up on computer

    Hi there, hope someone can help. I am having a problem with my 3G iPod with dock. Out of the blue my iPod will not connect to my computer using USB. It does however connect to my laptop through firewire, however this is no good as it is not power fir