How to query in memory on a subset?

TopLink query in memory is quite an exclusive feature. However, it doesn't the obvious need for indexing. If anybody has exposure to .NET they will be aware of a paradimn shift of using SQL against structure in memory. I would like in my application to use TopLink query in memory to query against a specific list of persistent objects. I mean, I don't want TopLink iterate the 5000 instance of class X that is in the cache. I would like the following use cases be supported:
- query against UOW registered object, excluding session cache
- query against a specific list of registered objects
Please provide existing API in TopLink 10.x and if only exist in EclipseLink, let me know the API.
If API is missing, please create enhancement request and let me know the number.

Below are the use cases so that you can easily derive API needed:
1- Load all instances of class X, the query for specific instances with where condition other than PK
- if loading is just one time, then query should check both uow/session, so already supported, but need index if lot of data.
- another way to see this, is that for each class that doesn't have too much instances, we want to load everything in memory, then redirect all query against the class to be in memory.
2- Batch method handling a range or subset. Like on a domain having many organizations. Start by getting all timesheets of organization X for last week from DB for optimization purpose. Then code start to classify/process the data, like query in memory for timesheets of this subset with state x, then y, z. This last query could just be against UOW, because just loaded the data. However, next query, which is againt only timesheet with state x, should ideally be against the list of timesheet with state x already populated in a collection. So having scope on UOW should be used only for performance, but having scope on a specific collection provide both specific result and performance. This use case may seems weird, but in complex/legacy application, it's often the case that we have existing not batch oriented code, which query for similar subset one after another which is not performant. Then faster refactoring to get performance, is to try to not modify existing not batch oriented query but redirect to memory when we are able to insure that memory is loaded with data needed before jumping on the not batch oriented legacy code.
3- Simplification of iteration by moving from verbose Java to SQL. We do have lot of code having a Collection of a Map having a Map. Then iterate when looking at some state of the leaf item we still filter out stuff. Be able to query in memory against collection/set, should simplify our code.
4- Remove duplicate SQLs. Complex application may end-up with different module calling same module to get a piece of information, so duplicate SQLs sent to DB if query is not against PK. Like select * from X where FK = y. If FK is unique, then I can avoid all duplicate SQLs to be sent to DB by looking first in UOW if any instances of object X exist with FK = y. In this case I want to look only in UOW for performance reason because index is not supported.

Similar Messages

  • How many query possible in 1 second at Sql Server ?

    Hello
    I have 30,000 records. Table have 10 columns. Columns have indexes if column at where condition. And select question will give 20-30 records as result. (select column1, column2,...... column10 from table where columnSecondID=2I. I will use hosting standart
    plane. 
    How many query possible in 1 second at Sql Server 2008 ?
    How many query possible in 1 second at Sql Server 2012 ?
    How many user can visit my web site ?

    Hello
    I have 30,000 records. Table have 10 columns. Columns have indexes if column at where condition. And select question will give 20-30 records as result. I will use hosting standart plane. 
    How many query possible in 1 second at Sql Server 2008 ?
    How many query possible in 1 second at Sql Server 2012 ?
    How many user can visit my web site ?
    That's hard to say. One second for CPU is quite high time and CPU can do lot of work in that time. again, this is relative and depends on what the query is.
    The biggest bottleneck in performance is - Disk IO system. In general, if  the required data is in memory, it can help significantly in improving the performance.
    Remember, CPU will be doing other processing work while it is fetching the data from disk.
    What you need to is  - load test or stress your server. There are some tools available for you to do it. 
    RML : https://support.microsoft.com/en-us/kb/944837?wa=wsignin1.0
    distributed replay : https://msdn.microsoft.com/en-us/library/ff878183.aspx
    to test IO : http://www.brentozar.com/archive/2008/11/storage-performance-testing-with-sqlio/
    read this : http://www.brentozar.com/archive/2012/06/load-test-sqlserver/
    You also need to look at Max worker thread limitations. this depends on the server configuration(64 bit/32 bit) and other factors...
    https://technet.microsoft.com/en-us/library/ms187024%28v=sql.105%29.aspx
    one problem that can happend is thread pool starvation where there are too many connections
    happening if your server cannot keep up with the workload.. like if your cpu is working in processing the queries and cannot accept new connections..
    watch this good youtube video on thread pool starvatioin :
     https://www.youtube.com/watch?v=XJ67oHBM2Hw
    Hope it Helps!!

  • How can I measure memory allocation of a Java Application?

    We built a web application that enables images to be loaded into a database through a servlet running on Tomcat. We have inconsistent behaivor when more than x number of people are loading images simultaneously. No doubt a memory allocation problem, but how can I measure it?
    For example, I'd like to be able to create a graph showing the resources used against the number of people making uploads. I am using Linux and Tomcat/Apache.
    I am hoping for something like Memory counters that are available for measurine Windows applications on MS Windows - comes with the Resource Kit. Does this type of tool exist for the Java/Linux market?

    It is difficult to gauge memory usage from a Java application as the JVM handles garbage collection and even if objects are not referenced they might still be sitting in memory until the next garbage collect.
    Anyhow, a way to query available memory is:
    Runtime.getRuntime().freeMemory()
    You can run this at the begining of a process and at the end and examine the difference. You should call System.gc() before each freeMemory() call in order to try to force garbage collection.
    Another method would be to turn to the underlying OS. On linux you could use 'top' or 'ps'. With ps you could do something like:
    ps -o rss,vsz,%mem <pid>
    Where <pid> is the parent Tomcat process' id. The resulting three columns are:
    - Amount of real memory used.
    - Amount of virtual memory used.
    - Percentage of real memory used.
    'man ps' wil give you more options on how to use ps.
    There are also fancy graphical stuff like 'gtop' as well.
    Hope this helps.

  • How to query opening balance for all customer or Vendor for an speci. date

    Hi,
    How to query opening balance for all customer or Vendor for an specific date?
    Example:
    put any date and query will show all customer/ Vendor  that date opening/current balance.
    Regards,
    Mizan

    Hi mizan700 ,
    Try this
    SELECT T0.[DocNum] As 'Doc No.', T0.[CardCode] As 'Customer Code',
    T0.[CardName] As 'Customer Name',(T0.[DocTotal]-T0.[PaidSys]) As 'O/S Balance'
    FROM OINV T0 INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode
    INNER JOIN OCRG T2 on T1.GroupCode = T2.GroupCode
    INNER JOIN INV1 T3 ON T0.DocEntry = T3.DocEntry
    WHERE T0.[DocStatus] ='O'
    AND
    (T0.[DocDate] >='[%0]' AND T0.[DocDate] <='[%1]')
    Regards:
    Balaji.S

  • How to overcome the Memory leakage issue in crystal report 2008 SP2 setup.

    I have developed the small windows based application tool with help of  Visual studio 2008 for identify the memory consumption of crystal report object. It helps to load the crystal report objects in the memory and then released the object from the memory. The tool simply does the u201CLoading and Unloadingu201D the objects in the memory.
    The tool will be started once u201CTest_MemoryConsumption.Exeu201D executed. The u201CTest_MemoryConsumption.Exeu201D consumes u201C9768 KBu201D memory before load the crystal report object in memory. It means, 9768 KB is normal memory consumption for run the tool.
    Crystal report object initiated by the tool and object help to load the report in memory once the tool initiated the crystal report object. Now u201CTest_MemoryConsumption.Exeu201D consumes u201C34980 KBu201D memory during the crystal report object creation and report load process. The actual memory consumption of crystal report object is 34980u20139768=u201C25212u201DKBu201D. 
    The memory consumption u201C34980 KBu201D will be continued till the end of the process. The memory consumption will be reduced to u201C34652 KBu201D from u201C34980 KBu201D once report load process completed. It means, u201C328 KBu201D memory only released from the memory consumption. Tool enables the Release command for the crystal report object. But crystal report object does not respond to the command and will not release his memory consumption.
    The memory consumption u201C34652 KBu201D will be stayed in the memory once job ends.  If i again initiate the crystal report object then it crystal report object start to consume the memory from 34652 KB.
    Database objects and crystal report objects are properly used in the tool. The object release commands properly  communicated to crystal report setup. But the u201CCrystal report service pack 2u201D setup unable to respond the commands which has enabled from .Net Tool.  Crystal report objects are properly initiated and disposed in the tool. But the crystal report unable to release from the server.
    The memory consumption will be reduced once the server restarted or kill the application.
    Crystal report 2008 and crystal report 2008 SP2 setup available in the server.
    Microsoft .Net Framework 2.0 SP2, Microsoft .Net Framework 3.0 SP2 and Microsoft .Net Framework 3.5 SP1 are available in the server,
    Could you please suggesst how to avoid the memory consumption keep increasing and  how to release the memory consumption  once the crystal object disposed???

    Hi Don..
    My case is different one. I hope, the problem with Run time Installation setup file (Crystal report 2008 Serivce Pack2 installer) which we installed in the server.
    Let me explain with Live scenario which our client faced in crystal report 2008 Service pack2 Installer.
    Our client is using a application to help to print their reports. The application is developed with Windows service.
    Windows service keep on running in the server. Windows service executes the client 's crystal reports( Labels Report, Stock  report) which designed for clients need and the reports will be printed from printer. 
    10 Same type report (Label Report) will be printed in 1 minute. Reports are not printing during non business hours. But the windows service keep on running.  Memory cosumption of application will be 160 MB in business hours.
    For Example, On Monday the application memory consumption starts with 160 MB. The Memory consumption will be reached 165 MB  in peak business hours. Then the memory will be ended in163 MB in the End of Monday. It means, The memory consumption will be in 163 MB during the non business hours. Reports will not be printed in non business hours.
    On Tuesday, the application memory consumption starts with 163 MB and it will be reached 168 MB during the peak hours. The Memory consumption will be ended in 165 MB in the end of Tuesday.  The same process contiues till friday. End of friday, the memory consumption of the application will be ended with 170 MB.
    Application Memory Consumption slowly increasing in the server. In 5 days, Memory consumption reached Threshold value (170 MB) of the server. Application gets hanged up once the memory consumption reached 170 MB. We got the error messages as "Attempted to read write protected memory " / "Not Enough memory for process".  If we restart server / If we restart the service then memory consumption of application get reduced to 160 MB.
    From the above scenario, We came know that the either the problem with Application object or the problem crystal report object. In the application, We have checked dispose methods of application objects completly. I am sure that  application objects are properly disposed in the application. I hope the problem not with application objects. The problem with Crystal report objects.
    Application properly communicates the dispose methods to crystal report objects. Crystal report objects are not released from
    the memory.
    Crystal report 2008 Serive Pack 2 setup installed in the server. 
    As you said, If Crystal report runtime is not released from memory then memory consumption keep increase???  In service oriented architecture application, how to unload the crystal report runtime??
    Do you any fix for this kind of issue??
    Willl Crystal report 2008 service pack 3 help on this issue??

  • How do I add memory to my mac pro

    How do I add memory to my mac pro?

    www.apple.com/support/macpro
    www.macsales.com/memory/macpro
    Find the Mac Pro model, type of RAM, then compatible RAM.
    But you get further if you show some details of what you have now and plan for.
    www.macperforomanceguide.com - check articles on memory and performance

  • How do I add memory to a MacBook Pro?

    How do I add memory to my MacBook Pro?

    You have to open the bottom cover of the MBP to get to the memory slots.  There are about 10 very small screws around the perimeter, some of which are longer than others so you have to be very careful not to mix them up when you take the cover off.  You will need a very small phillips-head screwdriver (small jewelers size).   Once you have removed the screws you may have to gently pry the cover off (there is some sticky stuff inside).  You will then see the RAM slots more or less in the middle of the computer.
    The booklet that came with your MBP has instructions about how to insert/remove the RAM SODIMMs ... there is a plastic tab on each side of the SODIMMs that you push outward and the RAM will pop up slightly ... you can then gently pull it out.   Note there is a slot cut in the pin edge of the SODIMMs ... remember it's orientation so you put the new RAM in the same way.  It only goes in one way.
    It's wise to use the crucial.com Memory Advisor first so you get the exact kind & amount of RAM that is compatible with your MBP.

  • How do I install memory into the Pavilion 17z-F2 series laptops?

    How do I install memory into the Pavilion 17z-F (17z-F200, product L2H13AV) series laptops?
    HP appears to have no maintenance guide available for this model series. What's up with that?
    Please, do not offer the generic (and out-of-date) Pavilion 17 Notebook PC Maintenance and Service Guide. It does not appear to apply to the 17z-F series. This guide instructs to remove the bottom service panel which I could have figured that out on my own. However, the 17z-F series does not appear to have any removable panels at all. I took an up-close look at the Pavilion 17z-F100. And, it does not have any removable panels on the underside, except for the battery. So, I presume the 17z-F200 to be the same.
    I am a computer technician. And, this is the first laptop I have seen without any service panels. I am probably going to have to disassemble the entire outer-shell to install memory (or to replace the hard disk drive once the time comes). But, every laptop I have worked on in the past had its own special array of hidden screws or special tricks for disassembly. So, having a maintenance guide is a necessity to avoid damaging plastic mounts, clips, guides, etc.
    This question was solved.
    View Solution.

    How about this one:
    Pavilion 17z Manual
    Don't get me started on this. It's one of my pet peeves, too. HP is not the only one doing this. Acer and Toshiba, etc. also are selling "closed" systems now. I hate it. I will absolutely never knowingly buy one but I am spending a lot of time here answering questions just like this. Good luck and let us know how you do. Sounds like you will be fine. 
    If this is "the Answer" please click "Accept as Solution" to help others find it. 

  • Looking for a simple example of how to query all the accounts

    I'm new to the web service model in oracle crm and have been trying to just get a list of the accounts in the system. I generated a .cs class from the account wsdl and added it to my asp.net project. I'm able to get a handle on the account class but not sure the right syntax to make a call out.. As a fyi - i also have been able to login thru the service and obtain a session id.. so I'm that far..
    Are they any existing code examples on how to query this? This is what I have so far but i throws an exception -
    Account act = new Account();
    act.Url = "https://"+dbcon.serverName+"/Services/Integration;jsessionid="+ sID;
    AccountWS_AccountQueryPage_Input qbe = new AccountWS_AccountQueryPage_Input();
    AccountWS_AccountQueryPage_Output qRet;
    qbe.ListOfAccount = new Account1[1];
    qbe.ListOfAccount[0] = new Account1();
    qbe.PageSize = "20";
    qbe.StartRowNum = "0";
    qbe.ListOfAccount[0].AccountId = "";
    qbe.ListOfAccount[0].Description = "";
    //act.CookieContainer = .... is this line needed?
    qRet = act.AccountQueryPage(qbe);
    return qRet.ToString();
    Thanks in advance for your help - Todd
    Edited by: user11139473 on May 6, 2009 6:33 PM

    Hi,
    I am doing the same thing but I am not sure what is Account1 in your case. Can you show me the implementation of Account1 class?
    Account act = new Account();
    act.Url = "https://"dbcon.serverName"/Services/Integration;jsessionid="+ sID;
    AccountWS_AccountQueryPage_Input qbe = new AccountWS_AccountQueryPage_Input();
    AccountWS_AccountQueryPage_Output qRet;
    qbe.ListOfAccount = new Account1[1]; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< qbe.ListOfAccount = new ListOfAccountQuery();
    qbe.ListOfAccount[0] = new Account1(); <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    qbe.PageSize = "20";
    qbe.StartRowNum = "0";
    qbe.ListOfAccount[0].AccountId = ""; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    qbe.ListOfAccount[0].Description = ""; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    //act.CookieContainer = .... is this line needed?
    qRet = act.AccountQueryPage(qbe);
    return qRet.ToString();
    On the right is my line of code. The ListOfAccount member of AccountQueryPage_Input has datatype ListOfAccountQuery. In my case, a NULL is returned after the call.
    Did you code work in the end?
    Thanks

  • How do I install memory into the Pavilion 17z-F200 (part L2H13AV)

    How do I install memory into the Pavilion 17z-F200 (part L2H13AV)?
    HP appears to have no maintenance guide available for this model. What's up with that?
    I took a look at the Pavilion 17z-F100 (sent by mistake). It does not have any removable panels on the underside. And, the User Guide for the 17z-F200 indicates that it will be the same (assuming it ever arrives).
    I am probably going to have to disassemble the entire outer-shell to install memory (or replace the hard disk drive, once the time comes). But, every laptop I have worked on in the past has had its own special place for hidden screws or special trick to disassembly. So, having a maintenance guide is a necessity to avoid damaging plastic mounts, clips, guides, etc.
    This question was solved.
    View Solution.

    @DLBurkhart ,
    Hello and thank you for posting on the HP support forums. Here is a link to the HP Pavilion 17 notebook Maintenance and service guide.
    HP Pavilion 17 Notebook PC Maintenance and Service Guide
    In the guide you will find the instructions on how to access the memory module and as well you should find the supported memory configurations.
    I hope this was helpful.
    Thank you for posting and have a great day
    Please click the "Thumbs Up" on the bottom right of this post to say thank you if you appreciate the support I provide!
    Also be sure to mark my post as “Accept as Solution" if you feel my post solved your issue, it will help others who face the same challenge find the same solution.
    D5GR
    I work on behalf of HP

  • How to free up memory in MacBook Pro?

    How to free up memory in MacBook Pro? (How to avoid getting the revolving rainbow?)

    I compressed some programs and data. I now have 4.56 GB free.
    SMART UTILITY http://www.volitans-software.com/smart_utility.php
    CAPACITY 80.0 GB
    SMART STATUS: YELLOW and "FAILING"
    "Removed 29 bad sectors
    Total errors 1708
    Reallocated 308 bad sectors"
    Do I need to buy Smart Utility?
    Had 5 simultaneous errors at READ DMA EXT. (I don't know what that means). I don't see all the windows that the web site shows. I guess that is for purchased downloads.
    I'd like to reinstate MobileMe's Backup function. Apple says it will work until June so that I could back that up until I get the backup hard drive. I was in the store last week; iCloud will not work on my computer.
    Thanks, DOTro

  • How to use abap memory in global class

    Hi experts,
                     I want to  know how to use abap memory in global class. when i try write export and import statement its showing
    error is export statement does not support in object oriented concept.
    Thanks
    Ramesh Manoharan

    Hi Ramesh,
    Export and import statements were not allowed to use in  classes. Create a global variable in public section of that class of type of  export parameter.Then pass value to the global variable of class  by calling that class.
    by
    Prasad GVK.

  • How to enable the memory remapping in the bios?

    How to enable the memory remapping in the bios?
    my laptop: m100 psmaaq-00s003

    Without removing a specific Windows Update KB Patch, and two registry keys, you CANNOT uninstall the Flash Player ActiveX Plug-in for IE in Win 8.
    Microsoft released a new update for Flash Player in IE just the other day.
    Have you run Windows Update recently?

  • How to query attributes with namespace in xmltable? thanks

    sample schema:
    <xsd:schema elementFormDefault="qualified" targetNamespace="http://www.tse.or.jp/jp/br/tdnet/ed/pt/2006-03-31">
    <xsd:element name="LocationOfHeadOffice" id="tse-ed-pt_LocationOfHeadOffice" type="xbrli:stringItemType" substitutionGroup="xbrli:item" abstract="false" nillable="true" xbrli:periodType="instant"/>
    <xsd:schema>
    My question is how to query the attribute xbrli:periodType using function xmltable.
    My query statement(it's just a part of it and it does not work):
    xmltable(XMLNamespaces('http://www.w3.org/2001/XMLSchema' as xs,
    'http://www.xbrl.org/2003/instance' as xbrli),
    '/xs:schema/xs:element'
    passing a.schema
    columns periodType varchar2(1000) path '@xbrli:periodType') b
    And the error message:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00601: Invalid token in: '/*/@xs:nillable'
    In fact, with standard xpath "doc("taxonomy.xsd")/xs:schema/xs:element/@xbrli:periodType", we can use the namespace with attributes, but why the xmltable function does not support it?
    And, how can I query this attribute?
    Thanks a lot.

    sorry for the mistake, the error message:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00601: Invalid token in: '/*/@xbrli:periodType'

  • How to query from the xml table a single, specified element.

    I'm quite new in Xml Db. Pleas, can anybody tell me how to query from the xml table below a single element (i.e. the element 'rapportoparentela = NIPOTE' related to the element 'codicefiscale = CRRVNC76R52G337R', or the element 'rapportoparentela = FIGLIO' related to the element 'codicefiscale = CRRRNT51L23G337Q')?
    - <dati xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <codiceinterno />
    <codicefiscaleassistito>CRRMNL81R31G337H</codicefiscaleassistito>
    - <famigliare>
    <codicefiscale>CRRVNC76R52G337R</codicefiscale>
    <rapportoparentela>NIPOTE</rapportoparentela>
    </famigliare>
    - <famigliare>
    <codicefiscale>CRRRNT51L23G337Q</codicefiscale>
    <rapportoparentela>FIGLIO</rapportoparentela>
    </famigliare>
    - <famigliare>
    <codicefiscale>CBRPRN15S65E080W</codicefiscale>
    <rapportoparentela>I.S.</rapportoparentela>
    </famigliare>
    - <famigliare>
    <codicefiscale>CRRMNL81R31G337H</codicefiscale>
    <rapportoparentela>NIPOTE</rapportoparentela>
    </famigliare>
    - <famigliare>
    <codicefiscale>BCCCML54C50I845G</codicefiscale>
    <rapportoparentela>NUORA</rapportoparentela>
    </famigliare>
    </dati>
    Using SELECT extractValue(value(t),'/rapportoparentela') into result FROM NF_XMLT X,
    TABLE ( xmlsequence (extract(value(X),'/dati/famigliare/rapportoparentela'))) t
    I get all the elements 'rapportoparentela' and I want to get only one specified.
    Regards.
    Piero

    Piero,
    you can add the condition "CRRVNC76R52G337R" to your xpath-expression like:
    SELECT extractValue(value(t),'/rapportoparentela')
    FROM NF_XMLT x
    ,TABLE ( xmlsequence (extract(value(X),'/dati/famigliare[rapportoparentela="CRRVNC76R52G337R"]'))) tto select only those famigliare-elements that have a child-element rapportoparentela with value "CRRVNC76R52G337R".
    When you stored your XML in an XMLType column in the table, i think the following queries are better:
    SELECT extractValue(x.your_XMLType_column,'/dati/famigliare/rapportoparentela')
    FROM NF_XMLT x
    WHERE extractValue(x.your_XMLType_column,'/dati/famigliare/codicefiscale')
    = 'CRRVNC76R52G337R'or
    SELECT extractValue(x.your_XMLType_column,'/dati/famigliare/rapportoparentela')
    FROM NF_XMLT x
    WHERE existsNode(x.your_XMLType_column,'/dati/famigliare[codicefiscale="CRRVNC76R52G337R"]')
    != 0

Maybe you are looking for

  • Oracle Client in Citrix Server

    It is fail to install Oracle8i Client Release 3 (8.1.7) in our Citrix Metaframe server via Add/Remove programs. After I select the location of Client 8i installation path and press Next button, nothing was appeared. The oracle client installation nev

  • My phone wont charge at all and therefore will not turn on.

    My iphone5 will not charge and as a result it will not turn on. Please help

  • Integration of SQL database with XI

    Dear All, I have a req in that I have to connect to SQL Server database to XI system then from XI to ECC. To do this what are Connection should done from DatabaseXI-ECC. I have JDBC adapter in XI.Do I need install again in XI . how we will connect SQ

  • Mountain Lion Server Web Server not working after time machine restore

    Our Mountain Lion Server (mac mini) lost its drive yesterday.  We got a new mac mini and did a time machine restore.  Everything in the Server seems to be working (users, groups, file shares, etc) except for the web server. Trying to connect to the s

  • Album slideshows - prevent originals download

    I'm hesitant to post since I'm not in front of my Mac right now, but I'm wondering if there is a way to present album photos in a slideshow and prevent any easy possibility for a viewer to download the original photo. As a photographer I'd like for m