Urgent - Advtanges/ disadvantages of Datasource caching

Hi,
The application access to the ConnectionPool or MultiPool is done thru datasources. The Datsources are looked up using JNDI in the application. As this JNDI lookup is costly in terms of resources, how will it affect the application server's performance or application performance if:-
1) The datasource is looked up during the server startup or at any particular initialization point only once. The datasource handle then can be cached for further use. SO application needing to get connection can use the same datasource handle from the cache and thereby avoide making JNDI lookup everytime to get connection.
Is there any problem in the above approach if the entire application uses a single datasource handle for getting database connection. Problems like load balancing etc.
Can any one throw some light on this matter??
Cheers
:-)

Well, I'm running the code I submitted earlier and
that part seems to be working fine. I think my
trubles are theese:
- the same user accesses content quickly so one
request isn't finished before the next arrives.
- the connection I get though the Datasource is
closed by the code according to the first request,
but this closure, also closes the connection for the
second request.
Does this make any sense at all? Do I need to have my
DB methods synchronized? I use synchronization in
some places in the code, perhaps I shuld extend this
usage?No, it doesn't make much sense. Each request should obtain its own connection, use it and close it. Connections should not be cached by the application. If you do this you won't have any of the problems you mentioned before.
Just make sure you always close your connections. You could use finally blocks for this.
Alin.

Similar Messages

  • Urgent *Please help*  Export Datasource - Depedencies

    Hi All,
    I have generated export data source and loading the data from one BW system to another.
    Can anyone please tell me, what are the dependencies, i need to make sure and check for this process.
    Thanks,
    Nisha

    Which version are you in. Well something you need to look at is that the data is currently loaded into the target on which u have the export datasource.
    Also, if you have some lookup then see that has been loaded in that target also.
    Hope this helps.

  • Proxy migration issues - URGENT

    Hi, I had to run the manual fillattr to migrate the access rules and proxy configs for management through Imanager.
    It worked great on my one server, but on the other the whole process runs successfully but only the access rules are migrated. I also replaced the bmpxy.jar file. Still nothing. I urgently need to change the cache hierarchy client but cannot get access through Imanager. Running BM3.9.1.
    any suggestions please

    In article <[email protected]>, Janine wrote:
    > It worked great on my one server, but on the other the whole process
    > runs successfully but only the access rules are migrated. I also
    > replaced the bmpxy.jar file. Still nothing. I urgently need to change
    > the cache hierarchy client but cannot get access through Imanager.
    > Running BM3.9.1.
    >
    I just went through this with a client in South Africa...
    The original BM 3.9 had a limit of 15 authentication contexts. The
    3.9sp1 bmpxy.jar raised that to 99 contexts. Unfortunately, my client
    had either more than that limit, or something wrong with some entry
    that caused the fillattr to choke. (As it turns out, they may have had
    120 context entries).
    The solution was kind of tricky, though I'd do it differently if I had
    to again. In ConsoleOne, Other properties of the BM server you should
    see a BRDSRVS attribute called Default Context Lists. I think if you
    can go in there and manually delete some of them to get under the upper
    limit, that may work, and it's what I would try next time I have to do
    this. What I did was to delete the entire attribute and add it back
    in, with blank values.
    That just gave a different set of errors on the logger screen during
    fillattr. (And 1.5 million lost entries scrolled off the top of the
    screen)...
    What I had to do was to put in one valid entry in the context list,
    manually, and I ended up having to do that in hex. When I finally
    figured it out, it wasn't hard because I had an existing entry in
    another server to copy. (When you type in hex in the left window, the
    decimal text shows on the right window, so it's not as bad as it
    sounds, but simply typing in the characters in the right window did not
    give the same hex code as the example I was using).
    Once I got down to a single valid entry in the context list, fillattr
    worked fine.
    If you need help, email me. I can at least send you a screenshot of
    something valid to type in.
    Craig Johnson
    Novell Support Connection SysOp
    *** For a current patch list, tips, handy files and books on
    BorderManager, go to http://www.craigjconsulting.com ***

  • Transporting error

    Hi experts,
    I am transfering dev to production
    development=551
    production=560
    After exporting from dev,while impoting in production i am getting error message like:
    DataSource 0BPARTNER_ATTR does not exist in source system WPRCLNT560 of version A
    clear steps to rectify it
    pls help me very very urgent
    regards
    rajesh

    Hi,
    The datasource 0BPARTNER_ATTR does not exist in PR3 in the active version. You need to transport it from DR3 to PR3 using RSA6. Then import  the request.
    Sometime restoring the myself destinations help in this type of
    situations.
    These errors could point to the issue that when transporting an object, not all the related objects are transported. Please be aware that the transferstructure should always be
    transported together with the transfer rules.  The transports should be done via the Transport Connection using the data flow before grouping option. This will ensure
    that dependent objects will be collected into the transport.
    Please perform the following steps
    - transport/install data source 0BPARTNER_ATTR in  source system  again and replicate in BW.
    - make a new transport in BW including infosource with all object below
    and transport it. In order to include all the necessary object, in
    RSA1->  Transport connection, please choose the option:  "Grouping in Dataflow before" (Very Important!)
    If this is usefull assign points..
    Cheers
    Rajesh

  • Prsonalize Portal

    Hi,
    I have to make my table get sorted according to the user selection. I try the example provided with the PDK for personalization and after some searching I was able to add a field property to my system component which displays a list of choices for sorting. But this list is only showing up in the system settings in the portal when I logged in as an admin. when the assigend portal user logs in, I cannot  see my dropdown in the personalize option. Please help, following is the code
    --Property defenition in my System component class(derived from SAP.Portal.Web.UI.PortalSystem)
        <PortalComponentFieldProperty(PlainDescription:="Sort Type", _
            PropertyType:=PropertyValueType.String, _
            UserPersonalization:=PersonalizationType.Dialog, _
            AdminPersonalization:=PersonalizationType.Dialog, _
            ValidValues:="8/Badge ID6/Status10/Punch Type", _
            Category:="Sort Order"), _
        DefaultValue("Badge ID")> _
        Public ReadOnly Property SortType() As String
            Get
                Return CType(GetValue("SortType"), String)
                'Return Me.Profile.Properties("SelectSortType").Value
            End Get
        End Property
    my page_load event code
      Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim s As New SAP_SystemComponent("Timelink_WrkForce")
            Dim isAuthenticated As Boolean = s.IsAuthenticated()
            If isAuthenticated Then
                'lblDescription.Text = Me.Profile.Properties("WorkforceStatus").Value
                LoadDataGrid(s)
                If Cache("WorkforceStatusPersonalization") Is Nothing Then
                    Cache("WorkforceStatusPersonalization") = Me.DataTable.DataSource
                Else
                    Me.DataTable.DataSource = Cache("WorkforceStatusPersonalization")
                End If
                Me.DataTable.DataBind()
    Inside the LoadDataGrid I check for the current assgined sort method and sort my query result according to that.
    (The sorting is working fine with default value once I set it from the Portal using the "admin" login)

    Hello,
    if restore from backup is no option (because of many changes since them) i would suggest to open an PSS call.
    See also this older Post:
    https://social.technet.microsoft.com/Forums/en-US/e7ce0f9a-752c-4cfe-8950-9ec1a7d309c3/administrator-account-deleted?forum=ilm2
    -Peter
    Peter Stapf - ExpertCircle GmbH - My blog:
    JustIDM.wordpress.com

  • Batch processing and maplisteners -detecting when the maplisteners complete

    Hi
    I have a scenario.
    Get data from data source 1 and load to cache (say datasource cache) . on this cache I have set maplistener that does some transformation puts the data to another cache. I want to start another process when data transformation is complete.
    Since I have not implemented synchronous listener, I have no way to know when the transformation is complete (as we may not know when all threads for maplistener for the datasource cache completes.
    Is there is a way to find out all the tranasformation is complete. (Please note that N record/object in a datasource may form one transformed record, hence counting may not be good ide)
    It is possible to do an update a flag in each record in datasource cache and make another thread to check if all records are transformed start the process. But I would like hear from your experience if you have any other better solution, that I can leverage from coherence itself. (in otherways, If I sense some inactivity in tranformed cache, I can safely assume that the transformation process is over). Views welcome !!!!
    regards
    Ganesan

    Hi Ganesan,
    Why don't you fire off some events from the transformation threads when they finished?
    You should be able to know how many transformation operations were to be done. When you get that many events that they completed, you are done.
    Best regards,
    Robert

  • Please make a swap partition optional at installation

    Because i have enough RAM i would like to skip the creation of a swap partition at the setup.
    Could you please make this available at the next (0.7) release?
    lubot

    As far as I remember Con Kolivas was testing some VM managers lately in his ck kernels.
    These include hard swapiness (in <2.6.8.1-ck4) and mapped watermark (in 2.6.8.1-ck4).
    http://members.optusnet.com.au/ckolivas/kernel/
    Sun Aug 22 20:19:47 EST 2004
    Mapped watermark??
    This readjusts the way memory is evicted by lightly removing cached ram once the ram is more than 2/3 full, if less than the "mapped watermark" percent of ram is mapped ram (ie applications). The normal system is to aggresively start scanning ram once it is completely full. The benefits of this are:
    1. Allocating memory while ram is being lightly scanned is faster and cheaper than when it is being heavily scanned.
    2. There is usually some free ram which tends to speed up application startup times.
    3. Swapping is an unusual event instead of a common one if you have enough ram for your workload.
    4. It is rare for your applications to be swapped out by file cache pressure.
    Disadvantage: Less file cache.
    The mapped watermark is configurable so a server for example might be happy to have a lower mapped percentage. The default is 66 and a server might like 33
    echo 33 > /proc/sys/vm/mapped
    This removes the swappiness knob entirely and deprecates all my previous vm hacks (autoregulated swappiness, hard swappiness, kiflush).
    You must be aware that the normal system usually shrinks the memory allocated for buffers & file cache until it becomes close to ZERO, making almost all the memory available for user applications.

  • When ejbCreate is invoked?

    hello
    i want to do some initial operation when the session bean is first created,but where my initial code should be?i think it should be "ejbCreate()" method,so that i make the following test:
    the ejbCreate method of my session bean:
    public void ejbCreate() throws CreateException {
    System.out.println("this is ejbCreate!");
    then i write a test client by using the jb6 test client wizard,in the test client,i invoke the create() method of the home interface of the session bean,i think that the ejbCreate method should be invoked,but it can't,the code snippet as:
    Context ctx = new InitialContext();
    Object ref = ctx.lookup("session");
    sessionHomeObject = (sessionHome) PortableRemoteObject.narrow(ref, sessionHome.class)
    session s=sessionHomeObject.create();
    when i execute the test client,the string "this is ejbCreate" can't be printed,but i can call any business method of the session bean in the client,i wonder when the ejbCreate method is executed?how can i do some initialization operation,because the session bean has not the constructor.

    Greetings,
    when i execute the test client,the string "this is
    ejbCreate" can't be printed,but i can call anyWhere are you looking for this? Information printed out to System.out|System.err in the server prints out on the server. Where exactly (logs, console, etc.) depends on the app server so read the docs.
    business method of the session bean in the client,i
    wonder when the ejbCreate method is executed?how can iWhen exactly it gets called depends on whether it's Stateful and the dynamics of the server (in the case of Stateless beans). In general, the lifecycle for SBs is:
    (NON-EXIST) -> newInstance() -> setSessionContext() -> ejbCreate -> (READY)
    do some initialization operation,because the sessionClient initialization should be done in ejbCreate. Bean initialization - anything that should be completed before ejbCreate is called (such as loading DataSources, caching references to other beans, etc.) - should be done in setSessionContext.
    bean has not the constructor.Erm, all Session Beans should provide a no-arg constructor for the benefit of the vendor's generation tools.
    I hope this helps.
    Regards,
    Tony "Vee Schade" Cook

  • URGENT : Problem in DataSource usage in Client applIcation

    URGENT : Problem in DataSource usage in Client applIcation
    Hi ALL
    I have deployed a EJB(Session Bean) in Oracle-OC4J Container.I am using datasources, in my bean as well as in my client
    application.Here Client is deployed along with bean in container.
    I am using "ejb-location"JNDI Name inside Client to get connection.
    (Which is mentioned in datasource element of datasources.xml)
    For this i have configured datasources.xml also.
    If i use "oracle.jdbc.pool.OracleDataSource" in datasources.xml then ClassNotFoundException is coming.
    But i have included classes12.jar in home/lib directory
    But if i use "com.evermind.sql.ConnectionDataSource" then i am getting connection.But if i do some operations(Even
    setAutoCommit(false))its giving NULL PointerException.
    Why this is happening?
    Thanx in advance
    Venky

    Hi Venkastesh,
    There are two issues. If your entry is like this....
    location="microDS"
    xa-location="jdbc/xa/MicroXADS"
    ejb-location="MicroPool"
    ...then use ejb-location for database calls through ejb and location when you try to get through normal java client.
    This will help you.
    regards,
    Vijay
    null

  • Urgent Help - Preventing Cache in Flex 3

    Hi all,
    Am new to this forum and i have a query which needs to be fixed urgently. Actually Flex 1.5 supports <cache> configuration variable in flex-config.xml which can be used to prevent client-side caching. But I suppose Flex 3 doesn't support the <cache> configuration variable, as am getting compilation error as 'unknown configuration variable compiler.cache' . Could any one please help me out with this? And also please suggest any ideas for preventing client-side caching. Also is there any other relative terms to <cache> configuration variable in Flex 3?
    I had referred the below url regarding the <cache> variable in Flex 1.5 , http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?co ntext=LiveDocs_Book_Parts&file=performance_118_13.html
    Thanks in Advance.

    Thanks a lot for the response.
    Actually i heard that using <cache> seems to be easy, where in  we could specify even the content-size to get cached (if we require) and also it just requires us to add something like <cache-mxml>false</cache-mxml> which will prevent the caching.
    And i have already tried appending the random number to the url. In the link provided by you, what does the swfObject refer to. I mean i couldn't find any reference to the object.
    Am trying like this,
    In index.template.html
    AC_FL_RunContent(
    "src", "${swf}?url="+Math.random(),"width", "${width}","height", "${height}","align", "middle",.........)
    Please guide me thru'.
    Thanks again

  • Purchase Info record Datasource / Infosource (URGENT!!!)

    BW GURUS!
    My client has an urgent need to extract their Purchase infor record in R/3 to the BW Environment.
    I am still new to BW Application - My solution is creating a custom Datasource in R/3 using the Purchase infor record Master table in R/3, then assign my datasource to custom infosource that will be created in BW.
    Question - is there an existing datasource / infosource for Purchase record info in R/3 and BW Business content I can use.
    With my proposed solution I will end up creating custom info-objects to build the communication structure for my infosource - I am trying to avoid this route.
    Looking forward to your input.
    Thanks Guys,
       Frank Obasohan

    Thanks Ramki,
    I located the info-object 0INFO_REC in my BW Business Content T-CODE rsorbct, I selected the info-object draged it to the right open panel, selected all its components and clicked on the "Install Icon" to activate the object, its still greg out (inactive).
      How do I activate the object? what 'am I doing wrong
    - Frank

  • Problem with DataSource lookup(Urgent)

    HI,
    I am facing a unique problem. I am migratinga application from weblogic to WAS. In a web module I wrote a normal class which will get the initial context of the server and create a connection object for the use of servlets. It is working fine in weblogic but when i have deployed the samething in WAS it is giving exception
    com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of MLJNDI.
    where MLJNDI is my DataSource jndi name.
    can anybody suggest me the solution?.This is very urgent.
    Thanks in advance.
    Ashok.

    It is not clear if you already created a Datasource to a specified database. This can be done via the Visual Admin.
    Services --> JDBC Connector. There you can upload vendor specific drivers and bind it to a database.
    This is possible usings the standards. JDBC 1.x and 2.0 way.
    Success.

  • What are the advantages/disadvantages to "Save Media Cache files next to originals when possible?

    I just noticed that I have over 7,000 files and 46.7 GB in my Media Cache Files folder.  I know I can just delete all the files in this folder and Premiere will automatically rebuild the files when needed.  But, are there any advantages or disadvantages to saving the files next to the originals?  I assume that means that it will write these files wherever I'm storing my media files...

    I'd say storing your cache with your media would decrease your performance.  Having them on separate volumes/drives means that Premiere can read/write from them at the same time, instead of having to read/write one or the other, one at a time.
    Additionally, PPro is create cache files from your original media, and it's always best practice to read from one drive, while writing to another.
    TL;DR It's for Performance. ! ! ! !

  • Caching of JNDI lookup'ed DataSources???

    What is the recommened pratice, using bean-managed Entity Beans, in regards to
    looking up the DataSource object from the JNDI tree?
    Is the best way to store the DataSource object in the session context when setEntityContext
    is called and release it on unsetEntityContext?
    or
    is it best if we lookup the DataSource object in every method and returns it back
    to the pool at the end of the same method? Like in the PETStore example from SUN.
    In a article from SUN "Seven Rules for Optimizing Entity Beans" they recommend
    to cache even DataSource objects. What is BEA's recommendation on this?
    http://developer.java.sun.com/developer/technicalArticles/ebeans/sevenrules
    Regards,
    Steen
    http://developer.java.sun.com/developer/technicalArticles/ebeans/sevenrules/

    I recommend doing the JNDI look-up in the setEntityContext method and
    storing the DataSource in a member variable.
    You should get the JDBC connection from the DataSource in each method
    and return it in each method.
    -- Rob
    Steen Laursen wrote:
    >
    What is the recommened pratice, using bean-managed Entity Beans, in regards to
    looking up the DataSource object from the JNDI tree?
    Is the best way to store the DataSource object in the session context when setEntityContext
    is called and release it on unsetEntityContext?
    or
    is it best if we lookup the DataSource object in every method and returns it back
    to the pool at the end of the same method? Like in the PETStore example from SUN.
    In a article from SUN "Seven Rules for Optimizing Entity Beans" they recommend
    to cache even DataSource objects. What is BEA's recommendation on this?
    http://developer.java.sun.com/developer/technicalArticles/ebeans/sevenrules
    Regards,
    Steen
    http://developer.java.sun.com/developer/technicalArticles/ebeans/sevenrules/
    AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
    by Michael Girdley, Rob Woollen, and Sandra Emerson
    http://learnWebLogic.com

  • Urgent : CO/PA Datasource Transport from R/3 DEV to R/3 QA

    Hello!
    I am trying to transport the CO/PA datasources that show up in RSA6 in R/3DEV to R/3 QA. All the transports have been moved. Nothing shows up in RSA6 of QA. I can display the datasource in KEB0 but cannot do the extraction in RSA3, as it gives the error 'It is not defined in the system".
    I have already executed the program ZCOPACLT and that is how I can display the datasource in KEB0.
    Am I missing something somewhere?
    Any suggestions are welcome.
    Kind of urgent. Appreciate your time.

    Hi Sonal,
    1) check in DEV if the extractstructure was generated there.
    2) check the object list of the transport to see wether the extractstructure was included.
    if the structure was not generated in DEV you might have to recreate the Datasource, unless anybody knows a better way.
    if the structure is inactive (e.g because Description is missing) try to activate the structure and recollect the transport.
    If the structure is available in Dev and active annd was not in transport you should recollect and retransport.
    Sorry, thats all I can think of right now.
    Michael

Maybe you are looking for

  • Quicktime and itunes problem

    when i try to uninstall quicktime it says that there is a fatal error and wont uninstall! anyone know what i can do to get quick time completely off my computer? ive tried deleting the two files and all that. when i install the new itunes, i try to o

  • Error in importing?

    hi friends, i am importing one user exported by 10gR2 databse into 10gR1 database, while importing i am getting following error. Export file created by EXPORT:V10.02.01 via conventional path import done in UTF8 character set and AL16UTF16 NCHAR chara

  • Animated content always in foreground. Indesign CS 5.5

    Hey, i got a huge problem. I am working on an ipad publication, viewing in adobe's content viewer for ipad. i have a lot of interaction going on in there. For example, if i wanna put a video file in one of my documents, or a scrollable content, or a

  • Data corruption in input processor

    Hi, We have class scoped variables in the input processor. What is happening is that when userA and userB are trying to access the screen concurrently userA's class scoped variables start showing data of userB. Does anyone know if the webflow framewo

  • Opacity Effect Not Working As Expected

    Hi, I noticed that whenever I animate the opacity of a clip that has a gamma correction efftect applied to it, the opacity does not work. Has anyone else seen this? thx